Kth Largest Element in an Array

Problem

Given an integer array nums and an integer k, return the element at position k when the array is sorted in descending order.

This is the kth largest element, not the kth distinct ele...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: