lcs problem, only max length now. will add logic to get the lcs later