Grokking Coding Mock Interview
Ask Author
Back to course home

0% completed

Vote For New Content

Solution: Identify the Largest Outlier in an Array
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Problem Statement

You are given an integer array nums. The array has n numbers. Out of these, exactly n - 2 numbers are called special. One of the other two numbers is equal to the sum of the special numbers. The remaining number is the outlier.

An outlier is not a special number or the element representing the sum of those numbers.

Return the largest possible outlier from nums.

Note: The special elements, the sum element, and the outliner may have same values but must have distinct indecies.

Examples

  • Example 1

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible