WHAT is error in my code for problem Tickets

WHY my code for this problem Tickets problelm is able to pass just one subtask not the other. What is error in my code.L5Amzw - Online C++0x Compiler & Debugging Tool - Ideone.com
please help me finding it out.

Consider the test input:

1
ABAC
1 Like

In this question,
You Basically need to loop on the string and compare the characters at index 1-3, 2-4, 3-5, 4-6 and so on. If they are equal simply print “Yes” ,else “No”.

Also in the starting itself compare whether s[0]==s[1] if true print “No” , else “Yes”.

If you get my idea try to code it. Otherwise reply back I will send the code to.

1 Like

Bro I will suggest use set…by using set it will reduce the time complexity also.