Skip to content

Instantly share code, notes, and snippets.

@praveeng1618
Created January 9, 2024 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save praveeng1618/da34428bca395efaa75b4ec04d9ecad3 to your computer and use it in GitHub Desktop.
Save praveeng1618/da34428bca395efaa75b4ec04d9ecad3 to your computer and use it in GitHub Desktop.
1. Two Sum Leetcode
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