-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Bug Report for kth-largest-element-in-an-array #5645
Copy link
Copy link
Open
Description
Bug Report for https://neetcode.io/problems/kth-largest-element-in-an-array
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
I receive this message when submitting code: Http failure response for https://neetcode.io/api/executeCodeFunctionHttp: 503 OK.
Code was valid to my knowledge as I submitted on LeetCode and it passed all test cases.
Code:
class Solution:
def findKthLargest(self, nums: List[int], k: int) -> int:
# minHeap of k largest values
minHeap = []
for num in nums:
heapq.heappush(minHeap, num)
while len(minHeap) > k:
heapq.heappop(minHeap)
return heapq.heappop(minHeap)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels