Alice and Bob continue their games with stones. There is a row of `n` stones, and each stone has an associated value. You are given an integer array `stones`, where `stones[i]` is the **value** of the `i`th stone. Alice and Bob take turns, with **Alice starting first**. On each turn, the player may **remove any stone** from `stones`. The player who removes a stone **loses** if the **sum** of the values of **all removed stones** is divisible by `3`. Bob will win automatically if there are no remaining stones (even if it is Alice's turn). Assuming both players play **optimally**, return `true` if Alice wins and `false` if Bob wins.
Example 1
Input: stones = [2,1]
Output: true
Explanation: Whichever stone Alice removes first (sum 2 or 1), Bob must remove the other one, which makes the sum 3. That is divisible by 3, so Bob loses and Alice wins.
Example 2
Input: stones = [2]
Output: false
Explanation: Alice removes the only stone, making the sum 2, which is not divisible by 3. The stones have now run out, and that counts as a win for Bob.
Example 3
Input: stones = [5,1,2,4,3]
Output: false
Explanation: With 5 stones, Alice removes the 1st, 3rd and 5th. If nobody makes the sum a multiple of 3, the stones run out after her last move, which counts as a win for Bob. Only remainders matter here (2, 1, 2, 1, 0), and whatever Alice picks, Bob always has a stone that keeps the sum off a multiple of 3. So Alice can never trap him, and Bob wins.
Only each stone's value mod 3 matters. Count how many stones fall in each remainder class 0/1/2. Remainder-0 stones are 'pass' moves that flip who acts; remainder-1 and remainder-2 stones drive the running sum. A short case analysis on those three counts decides the winner.
Run checks all cases above. Submit evaluates all test cases.