Here is the Problem Link
Soldiers And Cards
My Submission link is My Submission
Please Provide me a Hint. I am getting TLE on Test Case 29. I am applying Brute Force Algorithm.
Help Required.
Thanks!
Here is the Problem Link
Soldiers And Cards
My Submission link is My Submission
Please Provide me a Hint. I am getting TLE on Test Case 29. I am applying Brute Force Algorithm.
Help Required.
Thanks!
Note: In this case(i.e Test case 29) , both of the players stack reach to a situation from where Repetition of states starts i.e after few swaps the stacks become same(as some previous state) but not equal to initial situation as given in Input. so your equate() function always returns 0.and hence TLE.
Thanks Bro. I got it