# 코딩 문제 관련/파이썬

[HackerRank-python] Breaking the Records

Hwiyong Jo 2022. 7. 2. 22:57
def breakingRecords(scores):
    # Write your code here
    max_score = scores[0];min_score = scores[0]
    max_break = 0;min_break = 0
    
    for score in scores[1:]:
        if score > max_score:
            max_score = score
            max_break += 1       
        elif score < min_score:
            min_score = score
            min_break += 1
            
    return [max_break, min_break]