summaryrefslogtreecommitdiff
path: root/1_array_hashing/contains_duplicate.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-08-13 02:44:31 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-08-13 02:44:31 +0900
commit96ca9ae7b33545bb3d7f8797dcd08d043adccc19 (patch)
tree5931e2e5b8c2104ea80495f10bfa55041bca887b /1_array_hashing/contains_duplicate.py
parent0cb59e57fc21daaac47779f7a1e74dc605fa53a1 (diff)
Init
Diffstat (limited to '1_array_hashing/contains_duplicate.py')
-rw-r--r--1_array_hashing/contains_duplicate.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/1_array_hashing/contains_duplicate.py b/1_array_hashing/contains_duplicate.py
index 142bcca..e437e4f 100644
--- a/1_array_hashing/contains_duplicate.py
+++ b/1_array_hashing/contains_duplicate.py
@@ -21,17 +21,20 @@ Output: false
"""
+from typing import List
+
+
class Solution:
# 1. brute force
- def brute_force(self, nums: list[int]) -> bool:
+ def brute_force(self, nums: List[int]) -> bool:
return False
# 2. sorting
- def sorting(self, nums: list[int]) -> bool:
+ def sorting(self, nums: List[int]) -> bool:
return False
# 3. hashset
- def hashset(self, nums: list[int]) -> bool:
+ def hashset(self, nums: List[int]) -> bool:
hs = set()
for i in range(len(nums)):
if nums[i] in hs: