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.
Python
min_con, max_con = 0, 0
least_scr, most_scr = scores[0], scores[0]
for i in scores:
if i < least_scr:
min_con += 1
least_scr = i
elif i > most_scr :
max_con += 1
most_scr = i
else:
continue
return max_con, min_con
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 →
Python min_con, max_con = 0, 0 least_scr, most_scr = scores[0], scores[0] for i in scores: if i < least_scr: min_con += 1 least_scr = i elif i > most_scr : max_con += 1 most_scr = i else: continue