Created
January 9, 2024 09:09
-
-
Save praveeng1618/da34428bca395efaa75b4ec04d9ecad3 to your computer and use it in GitHub Desktop.
1. Two Sum Leetcode
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
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
a = [() for i in range(2)] | |
for i in range(0,len(nums)): | |
for j in range(i+1,len(nums)): | |
if target == nums[i]+nums[j]: | |
return [i,j] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment