From 6d8519dbc2c96c7c2d1589b9c69722591ec908f5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Aug 2026 04:54:47 -0600 Subject: [PATCH] adding udpates --- .../common_algos/two_sum_round_4.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_4.py diff --git a/src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_4.py b/src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_4.py new file mode 100644 index 00000000..656ae1f3 --- /dev/null +++ b/src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_4.py @@ -0,0 +1,18 @@ +from typing import List, Union, Collection, Mapping, Optional +from abc import ABC, abstractmethod + +class Solution: + def twoSum(self, nums: List[int], target: int) -> List[int]: + + answer = dict() + + for k, v in enumerate(nums): + + if v in answer: + return [answer[v], k] + else: + answer[target - v] = k + + return [] + +