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.
2 parents a8bda09 + 84c6eef commit e5b0c87Copy full SHA for e5b0c87
โcontains-duplicate/JiHyeonSu.pyโ
@@ -0,0 +1,5 @@
1
+# ์ค๋ณต์ ๊ฑฐ ํ ๊ธธ์ด ํ์ธ ๋ฌธ์
2
+# ์๊ฐ๋ณต์ก๋ ๋ฐ ๊ณต๊ฐ๋ณต์ก๋ O(n)
3
+class Solution:
4
+ def containsDuplicate(self, nums: List[int]) -> bool:
5
+ return len(nums) != len(set(nums))
โtwo-sum/JiHyeonSu.pyโ
@@ -0,0 +1,11 @@
+# ํด์๋งต์ ํ์ฉํ ๋ ์์ ํฉ ๊ตฌํ
+ def twoSum(self, nums: List[int], target: int) -> List[int]:
+ n_map = {}
6
+
7
+ for i, num in enumerate(nums):
8
+ diff = target - num
9
+ if diff in n_map:
10
+ return [n_map[diff], i]
11
+ n_map[num] = i
0 commit comments