fix a bug in LongestMonotonicallyIncreasingSubsequenceSize