Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
kth smallest element in a matrix
int kthSmallest(int mat[MAX][MAX], int n, int k) { //Your code here priority_queue<int>pq; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { pq.push(mat[i][j]); if(pq.size()>k) { pq.pop(); } } } return pq.top(); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
რიცხვები დაფაზა~ფინალური
Job Scheduling
C++ Solar eclipse program(Shoushi integrated) 1568 - 1644 also check Lunar eclipse for Xing Yunlu
Loop comparison
DBeach Resort 4R8J-8P (State of Rio Grande.do Norte Brazil)
Speed
LRU - Main
pointer to template function
Discounting Future Stream
maximum_frequent_sum
Please log in to post a comment.