From af16556fb38fe3af5ce4601fe0dfbe80fdf284ce Mon Sep 17 00:00:00 2001 From: Luv Agarwal <86291324+Luv761901@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:27:38 +0530 Subject: [PATCH] Create 0000.py --- Luv761901/0000/0000.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Luv761901/0000/0000.py diff --git a/Luv761901/0000/0000.py b/Luv761901/0000/0000.py new file mode 100644 index 00000000..1b22314f --- /dev/null +++ b/Luv761901/0000/0000.py @@ -0,0 +1,9 @@ +class Solution: + def twoSum(self, nums: List[int], target: int) -> List[int]: + d={} + print(d) + for i,j in enumerate(nums): + x=target-j + if x in d: + return [d[x],i] + d[j]=i