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

FULL DISCUSSION
 

Python :

def find_outlier(array):
    odd = [i for i in array if i%2 == 0]
    even = [i for i in array if i%2]

    if not even or not odd:
        return "ERROR"
    elif len(even) > len(odd):
        return odd[0]
    else:
        return even[0]
code of conduct - report abuse