Can anyone tell me why my answer is wrong for TICKETS5

Here is my solution.

1 Like

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

3 Likes

Yes, I am sorry about that:
Question : TICKETS5 Problem - CodeChef
Actually I have taken many approaches, to this
My first approach was

  1. CodeChef: Practical coding for everyone
    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
    CodeChef: Practical coding for everyone
    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: CodeChef: Practical coding for everyone