n turns. Every turn starts with 10 pins standing; alice[i] and bob[i] are how many pins each of them knocked down on turn i.
A turn is scored like this: if the player knocked down all 10 pins on either of the two previous turns, the pins of this turn count double; otherwise they count as is. A player's total is the sum over all turns.
Return 1 if Alice has more points, 2 if Bob does, and 0 for a draw.alice=[10, 4, 4, 9], bob=[7, 8, 9, 6] → 1
Alice strikes on the first turn, so the next two are doubled: 10 + 8 + 8 + 9 = 35. Bob has 7 + 8 + 9 + 6 = 30. Alice wins.
alice=[3, 3, 3], bob=[0, 10, 1] → 2
Alice scores 9. Bob scores 0 + 10 + 2 = 12. Bob wins.
alice=[10, 10, 0], bob=[10, 0, 10] → 0
Alice: 10 + 20 + 0 = 30. Bob: 10 + 0 + 20 = 30. A draw.
alice=[10, 4, 4, 9], bob=[7, 8, 9, 6]
1
Run checks the first 3 tests in your browser. Submit checks all 95 tests on the server, hidden ones included.