(root)
| 28 | // time O(n) where n is the number of nodes |
| 29 | // space O(n) |
| 30 | function branchSums(root) { |
| 31 | return branchSumsHelper(root, 0, (sums = [])); |
| 32 | } |
| 33 | |
| 34 | function branchSumsHelper(root, currentSum, sums) { |
| 35 | if (root !== null) { |
no test coverage detected