Skip to content

Commit 08a8b9a

Browse files
committed
two sum solution
1 parent c10802e commit 08a8b9a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

two-sum/6kitty.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# @lc app=leetcode id=1 lang=python3
3+
#
4+
# [1] Two Sum
5+
#
6+
7+
# @lc code=start
8+
class Solution:
9+
def twoSum(self, nums: List[int], target: int) -> List[int]:
10+
for i,num in enumerate(nums):
11+
for j in range(i+1,len(nums)):
12+
if num + nums[j] == target:
13+
return [i,j]
14+
15+
# @lc code=end
16+

0 commit comments

Comments
 (0)