Given an unsorted array of numbers, compute the largest distinct pair sum in the array with only one traversal .
What is the largest distinct pair sum in the text .
Details and Assumptions
For example in the array the largest pair sum is ).
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
You just need to find the largest and second largest integer in the array ( both distinct ). It is very easy to do it in a single iteration.