Leetcode Longest Common Substring Coding