Game of Chips

Two players take turns collecting chips from two piles. The piles contain A and B chips respectively. On each turn, a player may take any positive number of chips from exactly one pile, or take an equal number of chips from both piles simultaneously. The player who takes the last chip(s) wins.

Both players play optimally. Given the two pile sizes as an array [A, B], return 1 if the first player wins, and 2 if the second player wins.

Examples
Input: [2,1]
Output: 1
Hints

Game of Chips

Two players take turns collecting chips from two piles. The piles contain A and B chips respectively. On each turn, a player may take any positive number of chips from exactly one pile, or take an equal number of chips from both piles simultaneously. The player who takes the last chip(s) wins.