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.
defbreakingRecords(scores):ifnotscores:return0,0# Initialize variablesmin_score=scores[0]max_score=scores[0]min_breaks=0max_breaks=0# Iterate through the scoresforscoreinscores[1:]:ifscore<min_score:min_score=scoremin_breaks+=1elifscore>max_score:max_score=scoremax_breaks+=1returnmax_breaks,min_breaks
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 →