Derive an alphabet from a sorted list of words
Anonymous User
1237

I was given this problem in a recent interview and while I eventually managed to describe a solution, it took me a long time and wasn't one I was super happy with. Anybody care to solve this?

Given a list of words sorted in alphabetical order (with a limited, out of normal English order alphabet), return the alphabet in order. The words will all be the same length (but not necessarily include every letter) and will have no duplicate letters.

Example:
input = [ "cb", "ct", "bb", "tb" ]
output = [ 'c', 'b', 't' ]

Comments (3)