// simple PriorityQueue problem
public int findKthLargest(int[] nums, int k) {
PriorityQueue<Integer> minPQ = new PriorityQueue<Integer>
((a, b) -> Integer.compare(a, b));
for (int n : nums) {
minPQ.add(n);
if (minPQ.size() > k) {
minPQ.poll();
}
}
return minPQ.poll();
}