stack implementation
longest common subsequence