3222. Find the Winning Player in Coin Game Easy

@problem@discussion
#Math#Simulation#Game Theory



1/**
2 * [3222] Find the Winning Player in Coin Game
3 *
4 * You are given two positive integers x and y, denoting the number of coins with values 75 and 10 respectively.
5 * Alice and Bob are playing a game. Each turn, starting with Alice, the player must pick up coins with a total value 115. If the player is unable to do so, they lose the game.
6 * Return the name of the player who wins the game if both players play optimally.
7 *  
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">x = 2, y = 7</span>
11 * Output: <span class="example-io">"Alice"</span>
12 * Explanation:
13 * The game ends in a single turn:
14 * 
15 * 	Alice picks 1 coin with a value of 75 and 4 coins with a value of 10.
16 * </div>
17 * <strong class="example">Example 2:
18 * <div class="example-block">
19 * Input: <span class="example-io">x = 4, y = 11</span>
20 * Output: <span class="example-io">"Bob"</span>
21 * Explanation:
22 * The game ends in 2 turns:
23 * 
24 * 	Alice picks 1 coin with a value of 75 and 4 coins with a value of 10.
25 * 	Bob picks 1 coin with a value of 75 and 4 coins with a value of 10.
26 * </div>
27 *  
28 * Constraints:
29 * 
30 * 	1 <= x, y <= 100
31 * 
32 */
33pub struct Solution {}
34
35// problem: https://leetcode.com/problems/find-the-winning-player-in-coin-game/
36// discuss: https://leetcode.com/problems/find-the-winning-player-in-coin-game/discuss/?currentPage=1&orderBy=most_votes&query=
37
38// submission codes start here
39
40impl Solution {
41    pub fn winning_player(x: i32, y: i32) -> String {
42        String::new()
43    }
44}
45
46// submission codes end
47
48#[cfg(test)]
49mod tests {
50    use super::*;
51
52    #[test]
53    fn test_3222() {
54    }
55}
56


Back
© 2025 bowen.ge All Rights Reserved.