Odd One Out

Published by Helen Yu in

Write a function that returns True if exactly one word in the list differs in length from the rest. Return False in all other cases.

Examples

odd_one_out(["silly", "mom", "let", "the"]) ➞ True

odd_one_out(["swanky", "rhino", "moment"]) ➞ True

odd_one_out(["the", "them", "theme"]) ➞ False

odd_one_out(["very", "to", "an", "some"]) ➞ False

Notes

The length of the list will always have at least three or more words.

Watch a quick demo on how Edabit works.