1908. Game of Nim
Description
**Input:** piles = [1]
**Output:** true
**Explanation:** There is only one possible scenario:
- On the first turn, Alice removes one stone from the first pile. piles = [0].
- On the second turn, there are no stones left for Bob to remove. Alice wins.**Input:** piles = [1,1]
**Output:** false
**Explanation:** It can be proven that Bob will always win. One possible scenario is:
- On the first turn, Alice removes one stone from the first pile. piles = [0,1].
- On the second turn, Bob removes one stone from the second pile. piles = [0,0].
- On the third turn, there are no stones left for Alice to remove. Bob wins.ac
Previous1907. Count Salary CategoriesNext1909. Remove One Element to Make the Array Strictly Increasing
Last updated