Longest Increasing Subsequence II — CaffeCode