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