1302. Deepest Leaves Sum
Medium | Tree + Level-order Traversal | 80 ms (98.31%), 17.7 MB (89.56%)
Last updated
Was this helpful?
Medium | Tree + Level-order Traversal | 80 ms (98.31%), 17.7 MB (89.56%)
Last updated
Was this helpful?
Source: GitHub:
Given the root
of a binary tree, return the sum of values of its deepest leaves.
Follow the level-order traversal, keep maintaining the sum of all nodes' values in the current level until the final iteration.