Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

题解-排序Kth Largest Element in an Array翻译有误 #1227

Open
KLSMDN opened this issue Feb 27, 2023 · 2 comments
Open

题解-排序Kth Largest Element in an Array翻译有误 #1227

KLSMDN opened this issue Feb 27, 2023 · 2 comments

Comments

@KLSMDN
Copy link

KLSMDN commented Feb 27, 2023

Kth Largest Element in an Array:数组中第k大的元素

@pranjalisr
Copy link

Hello @KLSMDN is anyone assigned for this issue? It would be glad if I could be assigned to it and make my contribution. Thanks

@AmanBansal1706
Copy link

class Solution {
public int findKthLargest(int[] nums, int k) {
PriorityQueue pq = new PriorityQueue<>(Collections.reverseOrder());
for(int i:nums){
pq.add(i);
}
int q=1;
while(q!=k){
pq.poll();
q++;
}
return pq.poll();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants