I believe this would fail if the outlier is even and the rest are an odd number of odd numbers. The examples all have an even number of odd numbers. Can you check that?

It seems that I can’t make it right and as simple as it was. So I’ll stick with this solution:

def findOutlier numbers if numbers.first(3).count(&:even?) > 1 numbers.find(&:odd?) else numbers.find(&:even?) end end puts findOutlier([2, 4, 0, 100, 4, 11, 2602, 36]) puts findOutlier([160, 3, 1719, 19, 11, 13, -21, 33]) puts findOutlier([160, 3, 1719, 19, 11, 13, -21]) puts findOutlier([4, 8, 15, 16, 24, 42]) puts findOutlier([16, 6, 40, 66, 68, 28]) puts findOutlier([3,3])

We're a place where coders share, stay up-to-date and grow their careers.

We strive for transparency and don't collect excess data.

## re: Daily Challenge #35 - Find the Outlier VIEW POST

TOP OF THREAD FULL DISCUSSIONI believe this would fail if the outlier is even and the rest are an

oddnumber of odd numbers. The examples all have anevennumber of odd numbers. Can you check that?It seems that I can’t make it right and as simple as it was. So I’ll stick with this solution: