Given Sequence is 22,5,7,2,23,10,15,21,3,17.
An increasing subsequence of maximal length are {5, 7, 10 ,15, 21} and { 5,7,10,15,17} .
A Decreasing subsequence of maximal length are {22, 5 , 2}, {22, 5, 3}, {22, 7, 2}, {22, 7, 3}, {22, 10, 3}, {23, 15, 3}, {23, 10, 3}, {23, 21, 3}, {23, 21, 17}.......
A Decreasing subsequence of maximal length is {22, 5, 2} or any one of the above.