Skip to content

Practice Repeated Substring Pattern

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#459
LeetCode Problem

Repeated Substring Pattern

Problem Statement

Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.

Source: Repeated Substring Pattern on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
s = "abab"
Output
true

# Example 2

Input
s = "aba"
Output
false

# Example 3

Input
s = "abcabcabcabc"
Output
true

Constraints

1 <= s.length <= 10^4
s consists of lowercase English letters.

Related LeetCode Problems

Practice more problems similar to Repeated Substring Pattern.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.