NumPy allowed · plain Python earns 10 bonus points
Compute package compilation ordering and identify cyclic dependencies across software build graphs.
Implement resolve_build_order(dependencies): given a dictionary where keys are packages and values are lists of required prerequisites, determine a valid build sequence. Return {"has_cycle": bool, "build_order": list[str]}. If a cycle exists, build_order must be []. Break ties among available packages alphabetically.
resolve_build_order(dependencies: dict[str, list[str]]) -> dict