K Largest Integers

Given an integer array nums and integer k, output the largest k integers in descending order. Duplicates count independently. Use a min-heap of size k in O(n log k) time and O(k) extra spa...

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: