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
# export and import envs | |
conda env export > environment.yml | |
conda env create -f environment.yml |
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]: | |
for i in range(len(nums)): | |
for j in range(i+1, len(nums)): | |
a = nums[i] + nums[j] | |
if (a == target): | |
return [i, j] | |
return [0,0] |