<awangdev>Kth Largest Element in an Array_1.java
public int findKthLargest(int[] nums, int k) {
        if (nums == null || nums.length == 0) return -1;

        PriorityQueue<Integer> queue = new PriorityQueue<>(); 
        
        for (int i = 0; i < nums.length; i++) { 
            if (i < k || nums[i] > queue.peek()) queue.offer(nums[i]);
            if (queue.size() > k) queue.poll();
        }
        
        return queue.poll();
    }
public int sample_funcname ( int [ ] var_0 , int var_1 ) {
  if ( var_0 == null || var_0 . length == 0 ) return - 1 ;
  PriorityQueue < Integer > var_8 = new PriorityQueue < > ( ) ;
  for ( int var_9 = 0 ;
  var_9 < var_0 . length ;
  var_9 ++ ) {
    if ( var_9 < var_1 || var_0 [ var_9 ] > var_8 . peek ( ) ) var_8 . offer ( var_0 [ var_9 ] ) ;
    if ( var_8 . size ( ) > var_1 ) var_8 . poll ( ) ;
  }
  return var_8 . poll ( ) ;
}
