upd
This commit is contained in:
@@ -40,9 +40,11 @@ Given an integer array ~nums~ and an integer ~k~, return /the/ ~k~ /most frequen
|
||||
Write your approach here.
|
||||
|
||||
** TODO Python
|
||||
#+begin_src python
|
||||
#+begin_src python :lc-problem 347 :lc-lang python3
|
||||
class Solution:
|
||||
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
|
||||
from collections import Counter
|
||||
return [n for n, _ in Counter(nums).most_common(k)]
|
||||
#+end_src
|
||||
|
||||
** TODO C++
|
||||
|
||||
Reference in New Issue
Block a user