diff --git "a/leetcode3/\353\263\200\354\247\200\355\230\221/v2/3940. Limit Occurrences in Sorted Array.py" "b/leetcode3/\353\263\200\354\247\200\355\230\221/v2/3940. Limit Occurrences in Sorted Array.py" new file mode 100644 index 00000000..cd32cea1 --- /dev/null +++ "b/leetcode3/\353\263\200\354\247\200\355\230\221/v2/3940. Limit Occurrences in Sorted Array.py" @@ -0,0 +1,18 @@ + +''' +1. 아이디어 : +2. 시간복잡도 : + o(n * m) + +3. 자료구조/알고리즘 : +''' +class Solution: + def limitOccurrences(self, nums: list[int], k: int) -> list[int]: + ans = [] + + for i in nums: + if len([j for j in ans if j == i]) == k: + continue + ans.append(i) + + return ans \ No newline at end of file