[LeetCode][Kotlin] 347. Top K Frequent Elements
347. Top K Frequent ElementsGiven an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.정수 배열 nums와 정수 k가 주어지면 가장 자주 사용되는 k개의 요소를 반환합니다. 어떤 순서로든 답변을 반환할 수 있습니다. Example 1:Input: nums = [1,1,1,2,2,3], k = 2Output: [1,2] Example 2:Input: nums = [1], k = 1Output: [1] Constraints:1 -10^4 k is in the range [1, the number of unique elements..
2024. 8. 27.