Input: arr[] = {5, 2, 3, 4}
Output: 1
Explanation:
The given array can be rearranged to {5, 4, 3, 2}.
Since every element is occurring only once, the rearranged array forms a decreasing subsequence of maximum possible length.
Input: arr[] = {5, 2, 6, 5, 2, 4, 5, 2}
Output: 3
Explanation:
The given array can be rearranged to {5, 2, 6, 5, 4, 2, 5, 2}.
The 3 decreasing subsequences of maximum possible length possible from the given array are {6, 5, 4, 2}, {5, 2} and {5, 2}