summaryrefslogtreecommitdiff
path: root/1_array_hashing/two_sum.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-10-12 21:14:03 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-10-12 21:14:03 +0900
commitc5d28828011a89e408dc53cd61a812058c6c74ac (patch)
tree7385aed3c8d6e13a0e7b86a0914954d4811c5c0d /1_array_hashing/two_sum.py
parent9d2adfc00c421dd8c8f57fc4b8e242aac75067a5 (diff)
modified two_sum.py
Diffstat (limited to '1_array_hashing/two_sum.py')
-rw-r--r--1_array_hashing/two_sum.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/1_array_hashing/two_sum.py b/1_array_hashing/two_sum.py
index 676c32b..42ad48e 100644
--- a/1_array_hashing/two_sum.py
+++ b/1_array_hashing/two_sum.py
@@ -36,12 +36,12 @@ Constraints:
-10,000,000 <= target <= 10,000,000
"""
-from typing import List
+from typing import Dict, List
class Solution:
def hashmap(self, nums: List[int], target: int) -> List[int]:
- hm: dict = {}
+ hm: Dict = {}
for i, index in enumerate(nums):
if target - index in hm:
return [hm[target - index], i]