sample input
2
2
4 2
3
5 2 3
how second player is winning.
i think first player is winning.
sample input
2
2
4 2
3
5 2 3
how second player is winning.
i think first player is winning.
The second player wins if we consider the following moves :-
Player 1 breaks down 4 into 2 piles of 2 -> 2 2 2
Player 2 breaks down 2 into 2 piles of 1 -> 1 1 2 2
Player 1 breaks down 2 into 2 piles of 1 -> 1 1 1 1 2
Player 2 breaks down 2 into 2 piles of 1 -> 1 1 1 1 1 1
Player 1 now has no move therefore he loses.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.