Use a hash map from value to index:
For each index with value : - Compute - If is in the map, return - Otherwise, add to the map
If no pair found, return empty (but problem guarantees a solution exists). One pass through the array. Each element is checked and added once. Time: . Space: .