You are viewing a single comment's thread. Return to all comments →
I feel that the below solution is more 'pythonic' but obivously not well optimized
def breaking_records(score):
hs = [ i for i,item in enumerate(scores[1:]) if item>max(scores[0:i+1]) ]
ls = [ i for i,item in enumerate(scores[1:]) if item
return [len(hs), len(ls)]
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 →
I feel that the below solution is more 'pythonic' but obivously not well optimized
def breaking_records(score):
hs = [ i for i,item in enumerate(scores[1:]) if item>max(scores[0:i+1]) ]
ls = [ i for i,item in enumerate(scores[1:]) if item
return [len(hs), len(ls)]