Question
A package manager must compute an install order. You're given a list of package names and a list of dependency pairs [a, b] meaning package a depends on b (so b must be installed before a). Return a valid install order such that every dependency is installed before the package that needs it. When several packages are simultaneously installable, install the lexicographically smallest first to make the result deterministic. If the dependencies contain a cycle (no valid order exists), return an empty list. Dependency pairs referencing unknown packages are ignored.
install_order(packages: list[str], deps: list[list[str]]) → list[str][["app","lib","core"],[["app","lib"],["lib","core"]]]out["core","lib","app"]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.