Kth Largest Element
Easy

Problem Statement

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

Examples

1Example 1
Input:
{ "nums": [ 3, 2, 1, 5, 6, 4 ], "k": 2 }
Output:
5
2Example 2
Input:
{ "nums": [ 3, 2, 3, 1, 2, 4, 5, 5, 6 ], "k": 4 }
Output:
4
3Example 3
Input:
{ "nums": [ 1 ], "k": 1 }
Output:
1
Loading...

Sign in to Run Code and Submit