Why is this incorrect? I get the correct output for each test-case, however it is incorrect?
Anonymous User
63

class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
length = len(nums) - 1
count = 0
while count < length:
for x in range(0,length):
if nums[count] + nums[count + 1] == target:
list = [count,count + 1]
print (list)
exit()
else:
count = count + 1

Comments (2)