Repeated Substring Pattern Problem

Repeated Substring Pattern Problem — ExecCode School DSA Practice

Solve the Repeated Substring Pattern problem on ExecCode. Free online school DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a word. Your task is to figure out if this word is made by taking a smaller part of itself and repeating it many times. If it is, print “true”; otherwise, print “false”.

Examples

Input abab; Output True. Input aba; Output False

Constraints

1 <= n <= 10^5

Practice Repeated Substring Pattern free on ExecCode. Browse DSA problems, topic map, and placement guides.