An easier way to obtain the LCS pattern