Kth Smallest Quickselect

Programming Interview Medium 6 views
Back to Questions

Problem Description

You're given {x}. Compute kth smallest element using quickselect style and output it.

Input Format

First line n k. Second line n integers.

Output Format

One integer kth.

Sample Test Case

Input:
6 3 7 10 4 3 20 15
Output:
7

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next