2660. Determine the Winner of a Bowling Game
You are given two 0-indexed integer arrays
player1
andplayer2
, that represent the number of pins that player 1 and player 2 hit in a bowling game, respectively.The bowling game consists of
n
turns, and the number of pins in each turn is exactly10
.Assume a player hit
xi
pins in theith
turn. The value of theith
turn for the player is:
2xi
if the player hit10
pins in any of the previous two turns.- Otherwise, It is
xi
.The score of the player is the sum of the values of their
n
turns.Return
1
if the score of player 1 is more than the score of player 2,2
if the score of player 2 is more than the score of player 1, and0
in case of a draw.
1 | class Solution { |