Breaking the Records solution in Kotlin -HackerRank

10 5 20 20 4 5 2 25 1

fun breakingRecords(scores: Array<Int>): Array<Int> {
var maxTotal = 0
var minTotal = 0
var max = 0
var min = 0

for (x in 0 until scores.size) {
val it = scores[x]
if (x != 0) {
if (it > max) {
max = it
else if (it < min) {
min = it

} else {
max = it
min = it
return listOf(maxTotal, minTotal).toTypedArray()}




Hey curious person, I am Software Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 10 Best Plugins of WordPress development that are preferred most in 2022

Experimenting on humans

Implmenting Timeout in Golang

Add custom run script and print logs of build in XCode

[LeetCode]#1588. Sum of All Odd Length Subarrays

Secure network infrastructure for Azure Databricks workspaces (Part 1 — Overview)

Base seven one hundred forty-seven notation and pronunciation.

Extracting running data out of NRC/Nike + (Nike Run Club) using API’s

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Umar Syaid Himawan

Umar Syaid Himawan

Hey curious person, I am Software Developer

More from Medium

Why You Should Learn Kotlin in 2022

Kotlin Programming Language: Everything You Need to Know

How and When to convert a Utility function in Kotlin to an Extension Function

Learning Idiomatic Kotlin