InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Repeating Sub-Sequence

Given a string A, find if there is any subsequence that repeats itself.

A subsequence of a string is defined as a sequence of characters generated by deleting some characters in the string without changing the order of the remaining characters.

NOTE : sub-sequence length should be greater than or equal to 2.

Input Format:

The first and the only argument of input contains a string A.

Output Format:

Return an integer, 0 or 1:
    => 0 : False
    => 1 : True


1 <= length(A) <= 100


Input 1:
    A = "abab"

Output 1:

Explanation 1:
    "ab" is repeated.

Input 2:
    A = "abba"
Output 2:

Explanation 2:
    There is no repeating subsequence.
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 Repeating Sub-Sequence on Interview Code Editor
Sign Up
to access hints and editorial solutions for Repeating Sub-Sequence
Asked In:


Click here to start solving coding interview questions