diff options
| -rw-r--r-- | 1_array_hashing/contains_duplicate.py | 12 | ||||
| -rw-r--r-- | 1_array_hashing/group_anagram.py | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/1_array_hashing/contains_duplicate.py b/1_array_hashing/contains_duplicate.py index ab100ea..ce87903 100644 --- a/1_array_hashing/contains_duplicate.py +++ b/1_array_hashing/contains_duplicate.py @@ -18,6 +18,12 @@ Example 2: Input: nums = [1, 2, 3, 4] Output: false + +Example 3: + +Input: nums = [1, 3, 4, 1] + +Output: true """ from typing import List, Set @@ -42,9 +48,9 @@ class Solution: return False -case1 = [1, 2, 3, 4, 5] -case2 = [2, 2, 3, 4, 5] -case3 = [3, 4, 1, 6, 3] +case1 = [1, 2, 3, 3] +case2 = [1, 2, 3, 4] +case3 = [1, 3, 4, 1] solution = Solution() print(f"hashset case1: {solution.hashset(case1)}") print(f"hashset case2: {solution.hashset(case2)}") diff --git a/1_array_hashing/group_anagram.py b/1_array_hashing/group_anagram.py index f2085b2..77df0bc 100644 --- a/1_array_hashing/group_anagram.py +++ b/1_array_hashing/group_anagram.py @@ -65,7 +65,7 @@ video: https://youtu.be/vzdNOK2oB2E 1. dictionary time: O(m*n*26) = O(m*n) -space: O(m*n) +space: O() code: ```python class Solution: |
