String representation using its substring

Given a String consisting of lowercase English alphabets A, Find if the given string can be represented from a substring by iterating the substring two or more times.


Input Format

The only argument given is String A.

Output Format

Return 1 if the given string can be represented from a substring by iterating the substring two or more times
else return 0.

Constraints

1 <= length of the string <= 100000

For Example

Input 1:
    A = "abcabcabc"
Output 1:
    1

Input 2:
    A = "abcdabc"
Output 2: 
    0
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving String representation using its substring on Interview Code Editor
Sign Up
to access hints and editorial solutions for String representation using its substring

Discussion


Loading...
Click here to start solving coding interview questions