Given an array find the subsequence that needs to be removed so that the array becomes sorted.