• + 0 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)]