Last active
February 17, 2020 19:23
-
-
Save BharathKumarS/c257999a2d350a765f38f9078eebcb1f to your computer and use it in GitHub Desktop.
This was my first Leet Code attempt, Two Sum.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Solution works only on LeetCode | |
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
anums = nums | |
for i in range(len(nums)-1): | |
for j in range(i+1,len(anums)): | |
if nums[i] + anums[j] == target: | |
return[i,j] |
Author
BharathKumarS
commented
Feb 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment