Nth Smallest Element

Find the nth smallest element in an array by sorting in ascending order.

Code

General
sorted(arr)[n - 1]

Parameters

Array of numbers

Position (1-indexed)

Server

More Python Snippets