This is a verified interview question from Groww. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Maximum Towers - Groww" covers key patterns like Other.
"### Problem Find the maximum number of towers that will receive the signal. ### Input The first line contains two integers, N, denoting the number of towers, and K, denoting the maximum number of changes. The second line contains N space-separated integers, denoting the frequency of the receiver of each tower. ### Output The output contains a single integer denoting the maximum number of towers that will receive the signal. ### Explanation If Alex chooses the initial signal frequency as 10, the first tower will receive the signal and transmit it to the next tower. After receiving the signal at the second tower, change the frequency to 30 and transmit it to the next tower. The third tower will receive the signal and transmit it to the next tower. The fourth tower will not be able to receive the signal, and the signal moves to the next tower. The fifth tower will receive the signal. The total number of towers to receive the signal is 4."
Join thousands of developers practicing for Groww.