Question
Given a directed graph with n nodes (0..n-1) and directed edges [u, v], reconstruct an Eulerian path: a walk using every directed edge exactly once. If one exists, return the list of node labels visited in order (length = number_of_edges + 1); the path must begin at the unique vertex with out-degree minus in-degree equal to 1 when such a vertex exists, otherwise at the lowest-numbered vertex that has an outgoing edge. Within each vertex, leave via edges in the input order. If no Eulerian path exists, return []. Constraints: 1 <= n <= 1000.
eulerian_path_directed(n: int, edges: list[list[int]]) → list[int][3,[[0,1],[1,2]]]out[0,1,2]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.