Find first K frequency numbers /* * Input: int[] A = {1, 1, 2, 3, 4, 5, 2}; k = 3 * return the highest frequency numbers. * return: [1, 2, 3] or [1, 2, 4] or [1, 2, 5] * */ 找出出现频率前k的数字 SOLUTION 1: 先将数字全放入一个map, key为数字,value为frequency, 对map排序,时间复杂度是Nl…