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