Several piles of stones are given. Two players alternate turns, and on each turn a player removes any positive number of stones from exactly one pile. The player who cannot move (all piles empty) loses. Assuming optimal play, return true if the first player wins. The input is JSON {piles}.
Input: JSON {piles}.
Output: Boolean — true if the first player wins.
Input: {"piles":[1,2,3]}
Output: false
Explanation: The XOR is zero, so the first player loses.Input: {"piles":[1,1]}
Output: false
Explanation: Equal piles cancel out.Input: {"piles":[3]}
Output: true
Explanation: Take the whole pile.1<=n<=1000