pavel
val (max, min) = nums.fold((Int.MIN_VALUE to Int.MAX_VALUE)) { (largest, smallest), next -> max(largest, next) to min(smallest, next) }