I am not getting how the o/p is 6 and 5 respectively.
In the 1st test case ,
1 , 11 , 2 , 10 , 4 , 5 , 2 , 1
the answer should be 4 (for subsequence 4,5,2,1).
In the 1st test case ,
80 , 60 , 30 , 40 , 20 , 10
the answer should be 4 (for subsequence 30,40,20,10).