Longest Increasing Subsequence using Dynamic Programming Style