You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if nums[i] in hashtable and nums[i]*2 == target : #edge case when target is the sum of 2 identical numbers
return [hashtable[nums[i]], i]
hashtable[nums[i]] = i
for x in range(len(nums)):
complementary = target-nums[x]
if complementary in hashtable and complementary != nums[x]: #checks if target - number in list is another number in list and to not use same number and index twice