Company: Amazon
Difficulty: medium
Greatest Outlier Value A monitoring service detects outliers in arrays of integers. You are given an array `arr` of `n` integers. It was built like this: someone took `n - 2` **normal numbers**, appended **the sum of those `n - 2` normal numbers** as one more element, and appended one final element, the **outlier** - a value that plays neither of those two roles. The array was then shuffled, so the positions tell you nothing. Formally, an element `arr[i]` is a **potential outlier** if there is another index `j` (with `j != i`) such that `arr[j]` equals the sum of all the elements of `arr` except `arr[i]` and `arr[j]`. In that case `arr[j]` is the stored sum and the remaining `n - 2` elements are the normal numbers. Several elements can be potential outliers at once. Print the **greatest** of them. It is guaranteed that at least one potential outlier exists. Input Format The input follows the platform's custom-testing layout, one integer per line: The first line contains the intege