added lcs sol
if you have to caculate i-1 (where i may be 0) then its best to have an array of length required length +1