hi Joma, could we might avoid to go throught the entire array twice in this way? def getBonuses(performance): bonus = len(performance) * [1] for i in range(len(performance)-1): if performance[i] > performance[i+1]: bonus[i] += 1 elif performance[i] < performance[i+1]: bonus[i+1] += 1 return bonus
Are we assuming that the person on the far left is not compared to the person on the far right?
hi Joma, could we might avoid to go throught the entire array twice in this way?
def getBonuses(performance):
bonus = len(performance) * [1]
for i in range(len(performance)-1):
if performance[i] > performance[i+1]:
bonus[i] += 1
elif performance[i] < performance[i+1]:
bonus[i+1] += 1
return bonus
Joma can u make a video on how to get started as a competitive programmer
I also do videos about programming!😁🎬💻