minMaxOrNull

Returns the smallest and largest element as a pair, or null if the receiver is empty.

Both values are found in a single pass. A single-element receiver pairs the element with itself.