[LeetCode] (459) Repeated Substring Pattern

Basic Idea: try to obtain the original string using all possible repeated substring from the shortest to the longest.

Time Complexity is O(n^2)

Related posts