You are viewing a single comment's thread. Return to all comments →
def breakingRecords(s): j = 0 k = 0 p_min = scores[0] p_max = scores[0] for i in range(len(scores)): n_scores = scores[0:i + 1] min1 = min(n_scores) max1 = max(n_scores) if max1 > p_max: j += 1 p_max = max1 if min1 < p_min: k += 1 p_min = min1 return [j, k]
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 →
def breakingRecords(s): j = 0 k = 0 p_min = scores[0] p_max = scores[0] for i in range(len(scores)): n_scores = scores[0:i + 1] min1 = min(n_scores) max1 = max(n_scores) if max1 > p_max: j += 1 p_max = max1 if min1 < p_min: k += 1 p_min = min1 return [j, k]