Enter integers separated by commas. Spaces are ignored.



Enter the rank (e.g., 1 for the smallest, 2 for the second smallest).



Result

Elements <= Mid: -
Low Bound: –
High Bound: –

The Nth smallest element is found by repeatedly narrowing down the search space for the element’s value using binary search. We search within the range of possible values, and for each potential value (midpoint), we count how many elements in the array are less than or equal to it. This count helps us decide whether the Nth smallest element is smaller or larger than the midpoint.