Can anyone tell me why my answer is wrong for TICKETS5

Here is my solution.
https://www.codechef.com/submit/TICKETS5

1 Like

provide the right link and add some description about your approach.

3 Likes

Yes, I am sorry about that:
Question : https://www.codechef.com/problems/TICKETS5
Actually I have taken many approaches, to this
My first approach was

  1. https://www.codechef.com/viewsolution/32475109
    I am testing the characters in the string are tested, the loop is going like tickets[i]==tickets[i+2]
  2. In the second approach
    https://www.codechef.com/viewsolution/32478120
    I am testing the entire string with the first and the second character.

Both approaches fail for the test input:

1
AAAAAAA
1 Like

Don’t you think it will technically be a series, as the pattern is not broken.

By the way, thanks for pointing this out, I just got to learn what is does that subtask thing box under the code does. Thank you

1 Like

actually word ”alternate” is misleading, valid ones not restricted to this format, ABAB…, or CDCD…, actually any order is alternate for valid string has only two characters.

So just check if covers two character or not. my code: Solution: 56553324 | CodeChef