Why are we using a hash table to store the numbers given that we have a list as input? We can do this to save O(N) space, right?

def pair_with_targetsum(arr, target_sum):

for num in arr:

target = target_sum - num

if target in arr:

return [arr.index(num), arr.index(target)]

return [-1, -1]