PHP | Hashmap | O(n)
Code
# Code
```php []
class Solution {

    /**
     * @param Integer[] $nums
     * @return Integer
     */
    function getLargestOutlier($nums) {
        $T = array_sum($nums);
        $count = array_count_values($nums);
        $res = PHP_INT_MIN;
        foreach($nums as $num){
            $outlier = $T - $num -$num;
            if($outlier === $num){
                if($count[$num] > 1){
                    $res = max($res, $outlier);
                }
            }
            else if(isset($count[$outlier])){
                $res = max($res, $outlier);
            }
        }
        return $res;
    }
}
```
['PHP']