You are viewing a single comment's thread. Return to all comments →
Kotlin Solution
fun maxMin(k: Int, arr: Array<Int>): Int { arr.sort() return (0..arr.size - k).minOf { i -> arr[i + k - 1] - arr[i] } }
Seems like cookies are disabled on this browser, please enable them to open this website
Max Min
You are viewing a single comment's thread. Return to all comments →
Kotlin Solution