Buttom-up dp solution to LCS