Amazon interview question

Longest common substring from leetcode