comefrom: <qiyuangong>347_Top_K_Frequent_Elements_1.java
code: public List<Integer> topKFrequent(int[] nums, int k) {
      HashMap<Integer, Integer> count = new HashMap();
      for (int n: nums) {
        count.put(n, count.getOrDefault(n, 0) + 1);
      }
  
      PriorityQueue<Integer> heap =
              new PriorityQueue<Integer>((n1, n2) -> count.get(n1) - count.get(n2));
  
      for (int n: count.keySet()) {
        heap.add(n);
        if (heap.size() > k)
          heap.poll();
      }
  
      List<Integer> top_k = new LinkedList();
      while (!heap.isEmpty())
        top_k.add(heap.poll());
      Collections.reverse(top_k);
      return top_k;
    }
masked: public List < Integer > var_0 ( int [ ] var_1 , int var_2 ) {
    HashMap < Integer , Integer > var_3 = new HashMap ( ) ;
    for ( int var_4 : var_1 ) {
      var_3 . put ( var_4 , var_3 . getOrDefault ( var_4 , 0 ) + 1 ) ;
    }
    PriorityQueue < Integer > var_7 = new PriorityQueue < Integer > ( ( var_5 , var_6 ) -> var_3 . get ( var_5 ) - var_3 . get ( var_6 ) ) ;
    for ( int var_4 : var_3 . keySet ( ) ) {
      var_7 . add ( var_4 ) ;
      if ( var_7 . size ( ) > var_2 ) var_7 . poll ( ) ;
    }
    List < Integer > var_8 = new LinkedList ( ) ;
    while ( ! var_7 . isEmpty ( ) ) var_8 . add ( var_7 . poll ( ) ) ;
    Collections . reverse ( var_8 ) ;
    return var_8 ;
  }
  