3371. Identify the Largest Outlier in an Array
You are given an integer array
nums
. This array containsn
elements, where exactlyn - 2
elements are special numbers. One of the remaining two elements is the sum of these special numbers, and the other is an outlier.An outlier is defined as a number that is neither one of the original special numbers nor the element representing the sum of those numbers.
Note that special numbers, the sum element, and the outlier must have distinct indices, but may share the same value.
Return the largest potential outlier in
nums
.
1 | class Solution { |