added longestIncreasingSequence