You are viewing a single comment's thread. Return to all comments →
fun breakingRecords(scores:Array<Int>):Array<Int>{ var min =0 var max =0 var minCount=0 var maxCount=0 if (scores.isNotEmpty()){ min=scores[0] max=scores[0] } scores.forEach { if(min>it) { min = it minCount++ } if (max<it) { max = it maxCount++ } } return arrayOf(maxCount, minCount) }
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 →