leetcode_practice/two_sums/two_sums_my.py
2024-11-02 14:12:10 +03:00

13 lines
489 B
Python

from typing import List, Optional
class Solution:
def twoSum(self, nums: List[int], target: int) -> Optional[List[int]]:
for first_index, first_number in enumerate(nums):
for second_index, second_number in enumerate(nums):
if first_index == second_index:
pass
elif first_number + second_number == target:
return [first_index, second_index]
else:
continue