Practice Identify the Largest Outlier in an Array
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Identify the Largest Outlier in an Array
Problem Statement
You are given an integer array nums. This array contains n elements, where exactly n - 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.
Source: Identify the Largest Outlier in an Array on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [2,3,5,10]
10
# Example 2
nums = [-2,-1,-3,-6,4]
4
# Example 3
nums = [1,1,1,1,1,5,5]
5
Constraints
Related LeetCode Problems
Practice more problems similar to Identify the Largest Outlier in an Array.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.