codes. Every word has a "rhythm": the list of steps between neighbouring letters, where a step is the alphabet position of the next letter minus that of the current one (a is 0, b is 1, …, z is 25). For example, "lop" has rhythm [3, 1] and "dca" has rhythm [-1, -2].
All words in the array share the same rhythm except exactly one. Find and return that word.codes=["bdf", "kmo", "bce", "rtv"] → 'bce'
"bdf", "kmo" and "rtv" all have steps [2, 2]. "bce" has steps [1, 2], so it is the odd one out.
codes=["zy", "ba", "ab"] → 'ab'
"zy" and "ba" both step by -1, while "ab" steps by +1.
codes=["mmm", "qqq", "aaa", "tuu", "ccc"] → 'tuu'
codes=["bdf", "kmo", "bce", "rtv"]
'bce'
Run checks the first 3 tests in your browser. Submit checks all 21 tests on the server, hidden ones included.