Question
You are given a list of words sorted lexicographically according to an unknown alphabet of lowercase letters. Derive an order of the letters that is consistent with the sorting, and return it as a string. If multiple valid orders exist, return the one that is lexicographically smallest by normal English letter order among available choices at each step. Return an empty string if no valid order exists (the input is internally contradictory, including the case where a longer word precedes its own prefix).
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.