We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
python3
def gamingArray(arr):
curr_max = 0
bob_turn = True
for n in arr:
if n > curr_max:
curr_max = n
bob_turn = not bob_turn
return ['ANDY', 'BOB'][not bob_turn]
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Gaming Array
You are viewing a single comment's thread. Return to all comments →
python3 def gamingArray(arr): curr_max = 0 bob_turn = True for n in arr: if n > curr_max: curr_max = n bob_turn = not bob_turn return ['ANDY', 'BOB'][not bob_turn] `