We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Breaking the Records
- Discussions
Breaking the Records
Breaking the Records
Sort by
recency
|
186 Discussions
|
Please Login in order to post a comment
def breakingRecords(scores): max_score = min_score = None minrec_maxrec = [0, 0]
public static List breakingRecords(List scores) { // Write your code here List score = new ArrayList<>(); int min = scores.get(0), max = scores.get(0); int minc = 0, maxc = 0; for (Integer integer : scores) { if(integermax){ max = integer; maxc += 1; } } score.add(maxc); score.add(minc); return score; }
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]