Roof Top
Easy Accuracy: 33.93% Submissions: 8125 Points: 2

You are given heights of consecutive buildings. You can move from the roof of a building to the roof of next adjacent building. You need to find the maximum number of consecutive steps you can put forward such that you gain an increase in altitude.

Input:
The first line contains an integer T, denoting number of test cases. First line of each test case contains an integer N, denoting number of buildings. Second line of the test case contains N space separated integers, the ith integer denote the hieght of the ith building.

Output:
For each test case, print maximum number of consecutive steps he can put forward such that he increase in altitude, in separate lines. He initially is on the roof of the first building.

Constraints:
1 <= T <= 102
1 <= N <= 106
1 <= Ai <= 106

Example:
Input:

2
5
1 2 2 3 2
4
1 2 3 4
Output:
1
3

Explanation:
Testcase 1:
1, 2 or 2, 3 are the only consecutive buildings with increasing heights.
Testcase 2: 1 to 2 to 3 to 4 is the jump of length 3 to have maximum number of buildings with increasing heights.

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.