A subarray said to be strictly decreasing if its length is at least 2 and successive elemnet in the subarray, starting from the seond position, has a value strictly lesser than the proceding value. That is, for an integer array numbers[i]>numbers[j] foe every i = j-1
Conversely, a subarray said to be strictly increasing if its length is at least 2 and successive elemnet in the subarray, starting from the seond position, has a value strictly greater than the proceding value. That is, for an integer array numbers[i]<numbers[j] foe every i = j-1
Given an array of integers, if some subarray of length 0 or more is removed. Determine the longest subarray that is first strictly decreasing and then strictly increasing. for example, assume num=[2,4,6,8,7,8,9,6,6,8,9,7], removing the segment[5:7], i.e., 8,9,6. leaves te numbers, [2,4,6,8,7,6,8,9,7], so we have 8,7,6,8,9 is longest sequence with length 5. If no sequence found return 0.
test-1:
20
-49549
90823
-2150
55520
96107
-44230
-81998
16642
49608
-19334
96752
64452
80928
67534
-99164
45668
-37684
-23363
-61386
90997
Expected Output
7