PHP and Javascript solutions to hard challenge #6 - Longest Common Subsequence