LCS Algorithm Implementation. Source: https://www.hackerrank.com/challenges/dynamic-programming-classics-the-longest-common-subsequence/problem