FreeCareerPath
Build the PrimitiveHard

Alien Dictionary

Write `alien_order(words)` returning a letter order consistent with the given sorted word list, or `""` if none exists. Any valid order is accepted. ["wrt","wrf","er","ett","rftt"] -> "wertf" Compare adjacent words, find the first differing character, and that is one edge. Two traps: a word followed by its own proper prefix (`["abc","ab"]`) is invalid input and must return `""`; and every letter appearing anywhere must be in the output, even letters that produce no edges.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Alien Dictionary" are saved to your account — logging in takes a few seconds.

Alien Dictionary — FreeCareerPath