Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile!
Also - please link to the actual Problem - which Problem is the “Third Problem” depends on how they are sorted.
Now can you help?
and suggest where im wrong in my code
please help
1
6
baabaa
answer:
YES
2
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.
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
6
acbcab
Ans :
YES
2
Your code’s output : NO
both the above test cases passes on this code and still get WA