Problems > K-th Smallest > Editorial

K-th Smallest — Solution & Editorial

Back to the Problem

Sort and index — or use nth_element / quickselect for O(N) average.

Complexity: O(N log N)