You are viewing a single comment's thread. Return to all comments →
Python:
def breakingRecords(scores): h, l = scores[0], scores[0] ht, lt = 0,0 res = [] prev = 0 for i in range(1, len(scores)): if scores[i] > h and scores[i] != scores[prev]: h = scores[i] ht+=1 prev =i elif scores[i]< l: l = scores[i] lt+=1 res.append(ht) res.append(lt) return res
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: