(root, maxValue)
| 11 | }; |
| 12 | |
| 13 | const pathSum = (root, maxValue) => { |
| 14 | const isBaseCase = root === null; |
| 15 | if (isBaseCase) return 0; |
| 16 | |
| 17 | return dfs(root, maxValue); |
| 18 | }; |
| 19 | |
| 20 | const dfs = (node, maxValue) => { |
| 21 | const left = Math.max(0, pathSum(node.left, maxValue)); |
no test coverage detected