diff --git "a/leetcode3/\354\265\234\354\233\220\354\244\200/3852. Smallest Pair With Different Frequencies.py" "b/leetcode3/\354\265\234\354\233\220\354\244\200/3852. Smallest Pair With Different Frequencies.py" new file mode 100644 index 00000000..444f5e37 --- /dev/null +++ "b/leetcode3/\354\265\234\354\233\220\354\244\200/3852. Smallest Pair With Different Frequencies.py" @@ -0,0 +1,29 @@ +# + +''' +1. 아이디어 : + + +2. 시간복잡도 : + O(n**2) + +3. 자료구조/알고리즘 : + + +''' + +from collections import Counter +class Solution: + def minDistinctFreqPair(self, nums: list[int]) -> list[int]: + counter = Counter(nums) + nums.sort() + + for x in nums: + for y in nums: + if x == y or x >= y: + continue + if counter.get(x) == counter.get(y): + continue + return [x, y] + + return [-1, -1] \ No newline at end of file