java.lang.Object
g0401_0500.s0459_repeated_substring_pattern.Solution

public class Solution extends Object
459 - Repeated Substring Pattern.<p>Easy</p> <p>Given a string <code>s</code>, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> s = &ldquo;abab&rdquo;</p> <p><strong>Output:</strong> true</p> <p><strong>Explanation:</strong> It is the substring &ldquo;ab&rdquo; twice.</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> s = &ldquo;aba&rdquo;</p> <p><strong>Output:</strong> false</p> <p><strong>Example 3:</strong></p> <p><strong>Input:</strong> s = &ldquo;abcabcabcabc&rdquo;</p> <p><strong>Output:</strong> true</p> <p><strong>Explanation:</strong> It is the substring &ldquo;abc&rdquo; four times or the substring &ldquo;abcabc&rdquo; twice.</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= s.length <= 10<sup>4</sup></code></li> <li><code>s</code> consists of lowercase English letters.</li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • repeatedSubstringPattern

      public boolean repeatedSubstringPattern(String s)