Skip to content
C

Kth Largest Element

Mediumjavapythonccppjavascript

Given an unsorted array and an integer K, find the K-th largest 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 largest element.

Input (stdin)

Output

Run your code to see output here...