(p, q)
| 69 | }; |
| 70 | |
| 71 | const isSameNode = (p, q) => { |
| 72 | const isBaseCase = !(p || q); |
| 73 | if (isBaseCase) return true; |
| 74 | |
| 75 | const isBalanced = p && q; |
| 76 | if (!isBalanced) return false; |
| 77 | |
| 78 | const isSame = p.val === q.val; |
| 79 | if (!isSame) return false; |
| 80 | |
| 81 | return true; |
| 82 | }; |
| 83 | |
| 84 | const isSame = (p, q) => |
| 85 | isSameNode(p, q) && |
no outgoing calls
no test coverage detected