方块电面

// The 2-player game of Drawdown is played with a board made up of N groups of stones./‌/ At the start of each game a board and a list of moves are provided.
// Each move is a list of N integers, reflecting the number of stones the move removes from each group on the board.
// Moves can be re-used, but a move can no longer be performed if doing so would reduce the number of stones in any group below 0.
// After no more moves can be completed, player 1 wins if there are more stones at the first position on the board than at the last position. Otherwise, player 2 wins.

// Example: Let’s say the game begins with a board of [6, 4, 4, 4] and these are the available moves provided:
// 1. [-2, -2, 0, 0]
// 2. [-4, -4, -1, 0]
// 3. [0, 0, -2, -2]

// Player One: 6, Player Two: 2
// Initial board: [6, 4, 4, 4]
// Player 1 decides to perform move 1. New board: [4, 2, 4, 4]
// Player 2 can perform move 1 or move 3. They decide to perform move 1. New board: [2, 0, 4, 4]
// Player 1 has to perform move 3. New board: [2, 0, 2, 2]
// Player 2 has to perform move 3. New board: [2, 0, 0, 0]
// The game is now over and player 1 is the winner.

大清早状态不行,脑子犯懵,最后一俩问没做出来。
补充:

  1. check winning condition
  2. Make the ‌move
  3. How make get the winning results for each player
  4. Perf improvement.