We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b57ed3 commit 8b97e42Copy full SHA for 8b97e42
top-k-frequent-elements/WHYjun.py
@@ -1,8 +1,8 @@
1
class Solution:
2
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
3
- # Time complexity: O(nlogn)
+ # Time complexity: O(nlog(n))
4
# Space Complexity: O(n)
5
-
+
6
if len(nums) <= k:
7
return list(set(nums))
8
0 commit comments