Link for the problem is :
A string is called a Palpal string if it can be divided into contiguous substrings such that:
- Each character of the whole string belongs to exactly one substring.
- Each of these substrings is a palindrome with length greater than 1.
xyxyxy - It is one of the sample test cases provided.
Here goes the explanation provided:
(The string “xyxyxy” is already a Palpal string, since it can divided into “xyx” and “yxy”.)
Now the que is,
In case of “xyx” and “yxy”, it violates the1st condition(because of x and y being used in both substrings while they must be in exactly one), so how “xyx” and “yxy” is a possible answer?
I think it should be “xxx” and “yyy”.
Note: Codechef is considering answers as wrong if 1st condition is followed.