Kth Largest Element

Given an array and an integer k, find the k-th largest element in the array. Please write a program to implement this, using a heap data structure.

Input

  • An array nums[] containing n intege...

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: