<qiyuangong>414_Third_Maximum_Number_1.java
public int thirdMax(int[] nums) {
        PriorityQueue<Integer> pq = new PriorityQueue<>(3);
        Set<Integer> set = new HashSet<>();
        for (int i : nums) {
            if (set.contains(i)) continue;
            pq.offer(i);
            set.add(i);
            if (pq.size() > 3) set.remove(pq.poll());
        }
        while (pq.size() < 3 && pq.size() > 1) {
            pq.poll();
        }
        return pq.peek();
    }
public int sample_funcname ( int [ ] var_0 ) {
  PriorityQueue < Integer > var_4 = new PriorityQueue < > ( 3 ) ;
  Set < Integer > var_7 = new HashSet < > ( ) ;
  for ( int var_8 : var_0 ) {
    if ( var_7 . contains ( var_8 ) ) continue ;
    var_4 . offer ( var_8 ) ;
    var_7 . add ( var_8 ) ;
    if ( var_4 . size ( ) > 3 ) var_7 . remove ( var_4 . poll ( ) ) ;
  }
  while ( var_4 . size ( ) < 3 && var_4 . size ( ) > 1 ) {
    var_4 . poll ( ) ;
  }
  return var_4 . peek ( ) ;
}
