Tabulation approach: (O(n^2) approach)
=> Our fundamental state dp[i] becomes: longest increasing subsequence ending at ith
index. We initialize dp[0] = 1, then for i, we look for j from 0 to i-1 such that num[j] is less than num[i] and update
dp[i] = max(dp[i], num[j]+1).
Using binary search: