From 0d29a8e7b6318d46b22bc4c0f09c0594495a4604 Mon Sep 17 00:00:00 2001 From: 724thomas <724thomas@gmail.com> Date: Wed, 3 Jun 2026 05:47:22 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=B5=9C=EC=9B=90=EC=A4=80]=20Day02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...allest Pair With Different Frequencies.py" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "leetcode3/\354\265\234\354\233\220\354\244\200/3852. Smallest Pair With Different Frequencies.py" 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