Company: Bounteous × Accolite_15oct
Difficulty: medium
Signal Tower Gathering Problem Description A remote survey crew operates N relay stations, numbered from 0 to N-1, wired together with the base station at site 0 forming the center of the network. Whenever a newly discovered station gets added to the network, the crew tries to attach it as the left connection of its parent first; if the left slot is already taken, it attaches as the right connection instead. The crew logs a headcount of technicians stationed at each relay in their field ledger. To plan an upcoming maintenance gathering, the crew picks the meeting site using a chosen number M and a specific walk through the network. This walk visits the left connection first, then the station itself, and finally the right connection. The station that lands in the Mth position of that walk is where the gathering will be held, and its technician headcount is what you must report. Write an algorithm that finds the number of technicians stationed at the chosen relay. Input: Enter an integer