comefrom: <qiyuangong>692_Top_K_Frequent_Words_2.java
code: public List<String> topKFrequent(String[] words, int k) {
          Map<String, Integer> count = new HashMap();
          for (String word: words) {
              count.put(word, count.getOrDefault(word, 0) + 1);
          }
          PriorityQueue<String> heap = new PriorityQueue<String>(
                  (w1, w2) -> count.get(w1).equals(count.get(w2)) ?
                  w2.compareTo(w1) : count.get(w1) - count.get(w2) );
  
          for (String word: count.keySet()) {
              heap.offer(word);
              if (heap.size() > k) heap.poll();
          }
  
          List<String> ans = new ArrayList();
          while (!heap.isEmpty()) ans.add(heap.poll());
          Collections.reverse(ans);
          return ans;
      }
masked: public List < String > var_0 ( String [ ] var_1 , int var_2 ) {
    Map < String , Integer > var_3 = new HashMap ( ) ;
    for ( String var_4 : var_1 ) {
      var_3 . put ( var_4 , var_3 . getOrDefault ( var_4 , 0 ) + 1 ) ;
    }
    PriorityQueue < String > var_7 = new PriorityQueue < String > ( ( var_5 , var_6 ) -> var_3 . get ( var_5 ) . equals ( var_3 . get ( var_6 ) ) ? var_6 . compareTo ( var_5 ) : var_3 . get ( var_5 ) - var_3 . get ( var_6 ) ) ;
    for ( String var_4 : var_3 . keySet ( ) ) {
      var_7 . offer ( var_4 ) ;
      if ( var_7 . size ( ) > var_2 ) var_7 . poll ( ) ;
    }
    List < String > var_8 = new ArrayList ( ) ;
    while ( ! var_7 . isEmpty ( ) ) var_8 . add ( var_7 . poll ( ) ) ;
    Collections . reverse ( var_8 ) ;
    return var_8 ;
  }
  