@sagar1pant7 : Please give problem code or link to problem page . Also give a link to your submission , as the code pasted here is not easily readable . That will help others to help you better .
The above code gets AC (it’s setter’s solution, which just seems to be a “cleaner” implementation of the same idea you had)!
Hope you can fix it,
Bruno
PS: @vineetpaliwal, Sagar actually tagged the post, so you can get a reference for the problem editorial and respective links in contest and practice page on the right side of the page
@sagar1pant7 : There is minor “input reading” related problem in your code .
Replace the following line :
scanf("%d",&t);
with :
scanf("%d\n",&t);
and then it gives correct answer .
The problem is if new line character is not read , then the first time you read a candidate chess move from input you are actually reading the newline character and analyzing it .