A solution to the longest increasing subsequence problem
optimal solution requires a binary search