Kth Smallest Element
Easy

Problem Statement

Given an array of n integers, find the kth smallest element in the array.

Examples

1Example 1
Input:
{ "nums": [ 7, 10, 4, 3, 20, 15 ], "k": 3 }
Output:
7
2Example 2
Input:
{ "nums": [ 7, 10, 4, 3, 20, 15 ], "k": 4 }
Output:
10
3Example 3
Input:
{ "nums": [ 1 ], "k": 1 }
Output:
1
Loading...

Sign in to Run Code and Submit