February Lunchtime Error in SWAPPALI

https://www.codechef.com/viewsolution/29975737

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Also - please link to the actual Problem - which Problem is the “Third Problem” depends on how they are sorted.

1 Like

Now can you help?
and suggest where im wrong in my code

1 Like

please help

1
6
baabaa
answer:
YES
2

2 Likes

Still getting wrong answer
https://www.codechef.com/submit/complete/29982966

my code gives right answer on the above test case but still i got WA . can you suggest where i am wrong
https://www.codechef.com/viewsolution/29982742

No, your code doesn’t work on this test. It prints NO. When the answer is YES.
baabaa -> ababaa -> abaaba.

1 Like

In question it is written that “neither of these elements may be used in any other operation” . Is it referring to used indexes or letters of string?

Indexes. Neither of the indexes shall be used in any other operations.

1 Like

1
6
acbcab

Ans :
YES
2

Your code’s output : NO

both the above test cases passes on this code and still get WA