NumPy allowed · plain Python earns 10 bonus points
Traverse a binary tree level by level, alternating horizontal scan direction between left-to-right and right-to-left.
Implement zigzag_level_order(root): perform BFS level-order traversal, alternating the order of elements appended to each level list depending on whether the level index is even or odd.
zigzag_level_order(root: dict | None) -> list[list[int]]