There was an error while loading. Please reload this page.
2 parents 376d49f + c1c79bb commit f07a7b8Copy full SHA for f07a7b8
1 file changed
leetcode3/최민지/3940.py
@@ -0,0 +1,8 @@
1
+class Solution:
2
+ def limitOccurrences(self, nums: list[int], k: int) -> list[int]:
3
+ result = []
4
+ for n in nums:
5
+ if result.count(n) < k:
6
+ result.append(n)
7
+ return result
8
+
0 commit comments