Problem 3902 · Medium

Zigzag Level Sum of Binary Tree

Sum each level in alternating directions, stopping at the first node that lacks the child that direction needs.

Open the interactive visualisation