Solution to Longest Increasing Subsequence problem.