# [3222\. Find the Winning Player in Coin Game](https://leetcode.com/problems/find-the-winning-player-in-coin-game/) :::spoiler Solution ```cpp= class Solution { public: string losingPlayer(int x, int y) { int cnt = 0; while (x > 0 && y > 3) { x -= 1; y -= 4; ++cnt; } return cnt % 2 == 1 ? "Alice" : "Bob"; } }; ``` - T: $O(n)$ - S: $O(1)$ :::