You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other possibility is to use a min oriented priority queue that will store the K-th largest values.The algorithm iterates over the whole input and maintains the size of priority queue. */
public int findKthLargest2(int[] nums, int k) {
final PriorityQueue<Integer> pq = new PriorityQueue<>();