wrote LCS.java, longest common substring algorithm