longest common subsequence between 2 string (taken from http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence)