arnab2001 / DSA

Collection of DSA problems and solutions
37 stars 185 forks source link

kth largest element in an array #51

Open swag1223 opened 3 years ago

swag1223 commented 3 years ago

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.

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

i want to add solution of this problem covering all possible approaches (from sorting to quick select)

mauryanik commented 3 years ago

Hey there, Can you please assign me this issue? Thank You!

Parmesh119 commented 1 year ago

@swag1223, Hope you are fine. Can I also add some solutions here?