You are viewing a single comment's thread. Return to all comments →
Swift:
func breakingRecords(scores: [Int]) -> [Int] { var minScore = scores[0] var maxScore = scores[0] var minRecordCount = 0 var maxRecordCount = 0 for score in scores { if score > maxScore { maxScore = score maxRecordCount += 1 } if score < minScore { minScore = score minRecordCount += 1 } } return [maxRecordCount, minRecordCount] }
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 →
Swift: