Shortest Common Subsequence Leetcode Problems Javascript