Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 427 Bytes

File metadata and controls

12 lines (9 loc) · 427 Bytes

Problem 1: Priority Selection

Problem Statement

Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Can you solve it without sorting?

Input Format

  • An array of integers nums.
  • An integer k.

Example

Input: nums = [3, 2, 3, 1, 2, 4, 5, 5, 6], k = 4
Output: 4