``` val (max, min) = nums.fold((Int.MIN_VALUE t...
# functional
p
Copy code
val (max, min) = nums.fold((Int.MIN_VALUE to Int.MAX_VALUE)) { (largest, smallest), next ->
        max(largest, next) to min(smallest, next)
    }