LeetCode传送通道
很好的一道题!
核心知识点:
…①map频率统计;
…②优先级队列(不用的话见解法二)
//解法一
class Solution {
public int[] topKFrequent(int[] nums, int k) {
int[] result = new int[k];
//1.次数统计map
Map<Integer,Integer> map = new HashMap<>();
for(int num:nums){
map.put