(root)
| 58 | }; |
| 59 | |
| 60 | var isRootBalanced = (root) => { |
| 61 | const isBaseCase = root === null; |
| 62 | if (isBaseCase) return [-1, true]; |
| 63 | |
| 64 | return dfs(root); |
| 65 | }; |
| 66 | |
| 67 | var dfs = (root) => { |
| 68 | const [left, isLeftBalanced] = isRootBalanced(root.left); |
no test coverage detected