Tower Breakers

There are n towers, each initially of height m. Two players take turns. On each turn, a player chooses a tower of height h and reduces it to a divisor of h (strictly smaller than h). The player who makes the last move wins. Both play optimally. Return 1 if the first player wins, 2 if the second player wins.

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

Tower Breakers

There are `n` towers, each initially of height `m`. Two players take turns. On each turn, a player chooses a tower of height `h` and reduces it to a divisor of `h` (strictly smaller than `h`). The player who makes the last move wins. Both play optimally. Return 1 if the first player wins, 2 if the second player wins.