Algorithm/LeetCode
[LeetCode][Python3] 1.two-sum
dbwp031
2020. 12. 24. 16:27
반응형
dbwp031/LeetCode
my solution codes of problems from leetcode. Contribute to dbwp031/LeetCode development by creating an account on GitHub.
github.com
전체 코드입니다.
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
length = len(nums)
for i in range(0,length):
for j in range(i+1,length):
if(nums[i]+nums[j] == target):
return [i,j]
반응형