Kth Largest Element

Programming Interview Medium 5 views
Back to Questions

Problem Description

For each testcase you get n, k and n integers. Output the k-th largest element.

Input Format

First integer t. For each: n k then n integers.

Output Format

t lines answers.

Sample Test Case

Input:
2 6 2 3 2 1 5 6 4 4 4 10 9 8 7
Output:
5 7

Constraints

Sum of n over all testcases

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next