Sponsored
Use these hints if you're stuck. Try solving on your own first.
Simulate the game and try all possible moves for each player.
Solve with full IDE support and test cases