MCPcopy
hub / github.com/HuberTRoy/leetCode / findKthLargest

Function findKthLargest

Array/KthLargestElementInAnArray.js:87–95  ·  view source on GitHub ↗
(nums, k)

Source from the content-addressed store, hash-verified

85
86
87var findKthLargest = function(nums, k) {
88 // nums = nums.sort((a,b) => b-a)
89 // nums = sort(nums)
90 // nums = split(nums)
91 // nums = merge(nums[0], nums[1])
92 nums = sort2(nums)
93 // console.log(nums)
94 return nums[nums.length-k]
95};

Callers

nothing calls this directly

Calls 1

sort2Function · 0.85

Tested by

no test coverage detected