# MinMaxN Find the minimum and maximum k values in an iterable in O(n * k) time when k < log2 n, otherwise O(n log n + k)