...

/

Solution: Find K Largest Elements in the List

Solution: Find K Largest Elements in the List

Let’s solve the Find K Largest Elements in the List problem.

Statement

Given a list of integers, nums, and a positive integer, k, find the k largest elements in the list.

Constraints:

  • 11 \leq k \leq nums.length 103\leq 10^3

  • 104-10^4 \leq nums[i] ...