Skip to content
C

Kth Smallest Element

Mediumjavapythonccppjavascript

Given an unsorted array and an integer K, find the K-th smallest element (1-indexed).

Input Format

The first line contains two integers N and K. The second line contains N space-separated integers.

Output Format

Print the K-th smallest element.

Input (stdin)

Output

Run your code to see output here...