Implimentation of LCS using recursive solution