finished findMaxInIncreasingDecreasing and getMaxLengthBitonicSubArray