Buttom-up dp solution to LIS problem