Question
You are given a list of `words` sorted according to the rules of an unknown alphabet. Derive a possible ordering of the distinct letters consistent with that sort. If several orderings are valid, return the lexicographically smallest one (treating letters by normal ASCII for the tie-break). Return the empty string if no valid ordering exists (the input is internally contradictory, e.g. a prefix appears after its extension).
alien_order(words: list[str]) → str[["wrt","wrf","er","ett","rftt"]]out"wertf"State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.