Obviously, the time complexity is O(n2), where n is the length of the whole string. A standard backtracking process allows us to find the local optimal pseudo-periodic region t.