


The first line of input contains an integer 'T' representing the number of test cases or queries to be processed. Then the test case follows.
The first line of each test case contains a single integer ‘N’ representing the size of the array/list.
The second line of each test case contains ‘N’ single space-separated non-negative integers representing the array elements.
For each test case, print the length of the longest dangerous hill range.
Print the output of each test case in a separate line.
You do not need to print anything; it has already been taken care of. Just implement the function.
1 <= T <= 100
1 <= N <= 5000
0 <= HEIGHT[i] <= 10^5
Where ‘N’ is the number of elements in the array/list.
Time Limit: 1sec
We have a simple brute force solution for this problem. We will traverse over all possible subarrays/ranges of the array and for each of them, check if it is turbulent.
The key observation here is that a hill at index h ‘i’ constitutes to a dangerous range only if it either forms
We will maintain ‘currRange’ to track the length of the dangerous range ending at the current index.
Traverse the array and update it as follows:
We will return the maximum value of ‘currRange’ encountered in the process as our final answer.