HackerRank | Problem Solving | Gaming Array | Code with logic explanation

preview_player
Показать описание
Step by step explanation of Gaming Array problem on Hackerrank with code at the end.

Рекомендации по теме
Комментарии
Автор

def arrayGame(array):
for i in range(0, 20):
size = len(array)
if size < 1:
break
value_position = array.index(max(array))
array_1 = array[: value_position]
array = array_1
if i%2 == 0:
print("ANDY")
else:
print("BOB")

miguelangelbarros
Автор

I wrote the same solution as u and I have 3 error cases when the expected output conatains any ANDY{-truncated} Help please ?

rabaakhlifi
join shbcf.ru