Longest Common Substring Leetcode Problem