3360. Stone Removal Game Easy
1/**
2 * [3360] Stone Removal Game
3 *
4 * Alice and Bob are playing a game where they take turns removing stones from a pile, with Alice going first.
5 *
6 * Alice starts by removing exactly 10 stones on her first turn.
7 * For each subsequent turn, each player removes exactly 1 fewer stone than the previous opponent.
8 *
9 * The player who cannot make a move loses the game.
10 * Given a positive integer n, return true if Alice wins the game and false otherwise.
11 *
12 * <strong class="example">Example 1:
13 * <div class="example-block">
14 * Input: <span class="example-io">n = 12</span>
15 * Output: <span class="example-io">true</span>
16 * Explanation:
17 *
18 * Alice removes 10 stones on her first turn, leaving 2 stones for Bob.
19 * Bob cannot remove 9 stones, so Alice wins.
20 * </div>
21 * <strong class="example">Example 2:
22 * <div class="example-block">
23 * Input: <span class="example-io">n = 1</span>
24 * Output: <span class="example-io">false</span>
25 * Explanation:
26 *
27 * Alice cannot remove 10 stones, so Alice loses.
28 * </div>
29 *
30 * Constraints:
31 *
32 * 1 <= n <= 50
33 *
34 */
35pub struct Solution {}
36
37// problem: https://leetcode.com/problems/stone-removal-game/
38// discuss: https://leetcode.com/problems/stone-removal-game/discuss/?currentPage=1&orderBy=most_votes&query=
39
40// submission codes start here
41
42impl Solution {
43 pub fn can_alice_win(n: i32) -> bool {
44 false
45 }
46}
47
48// submission codes end
49
50#[cfg(test)]
51mod tests {
52 use super::*;
53
54 #[test]
55 fn test_3360() {
56 }
57}
58
Back
© 2025 bowen.ge All Rights Reserved.