Skip to main content
Kth Largest Element in an Array | AlgoCracked
AlgoCracked
ProblemsKth Largest Element in an Array
Medium67.0% acceptance
Blind75ArrayDivide And ConquerSortingHeap

Kth Largest Element in an Array

Given an integer array nums and an integer k , return the k -th largest element. This is the element in sorted-descending order at position k (a value, not a distinct rank — duplicates count each time). Input format Input is [nums, k] , e.g. [[3,2,1,5,6,4],2] .

Loading workspace…