Hi StackOverflow community, I am stuck on this problem thatI think is a variant of the longest increasing/decreasing subsequence (LIS/LDS). The question is to find the longest s