Constrained min/max value of an array
Another puzzle courtesy the Daily Coding Problem email list.
Daily Coding Problem: Problem #1578 [Hard]
This problem was asked by Facebook.
Given an array of numbers of length N
,
find both the minimum and maximum using less than 2 * (N - 2)
comparisons.
Github repo for my solution.