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.
def breakingRecords(scores):
max = min = scores[0]
result = [0,0]
for i in range(len(scores)):
if scores[i] > max:
max = scores[i]
result[0] += 1
elif scores[i] < min:
min = scores[i]
result[1] += 1
return result
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
def breakingRecords(scores): max = min = scores[0] result = [0,0] for i in range(len(scores)): if scores[i] > max: max = scores[i] result[0] += 1 elif scores[i] < min: min = scores[i] result[1] += 1 return result