Problem 1302 · Medium

Deepest Leaves Sum

Walk the tree one level at a time and keep the sum of the last level that has any nodes.

Open the interactive visualisation