I try to using a nested for loop, the time complexity is O (n ^ 2);

I try to using binary search , but the array is unsorted;

the hash table method, the time complexity is O (n).

```
def twoSum(self, nums, target):
d = { }
for i, n in enumerate(nums):
if target - n in d:
return [min(i, d[target-n]), max(i, d[target-n])]
d[n] = i
```