Leetcode #1302 Deepest Leaves Sum
We can use recursion to solve this, traversing the tree DFS.
Thought process:
Traverse the tree and increasing the depth each time
If we found the leaf node, keep track of the maximum depth
If we are already at the maximum depth, we increase our sum...
michelletanpy.hashnode.dev1 min read