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
Breaking the Records
Sort by
recency
|
2238 Discussions
|
Please Login in order to post a comment
JAVA Solution
public static List breakingRecords(List scores) { // Write your code here
**** C# public static List BreakRecords(List scores) { List recordcounts = new List() { 0, 0 };
}
**** C
public static List breakingRecords(List scores) {
int highCount = 0,lowCount = 0,highestScore = scores[0],lowestScore = scores[0]; if (scores.Count == 0) return new List { 0, 0 }; foreach(int item in scores){ if(item > highestScore){ highCount ++; highestScore = item; } else if(item
def breakingRecords(scores): max_score=scores[0] min_score=scores[0] max_count=0 min_count=0 for score in scores[1:]: if score>max_score: max_score=score max_count+=1 elif score