(x: Node, y: Node, level: int = None)
| 404 | |
| 405 | |
| 406 | def why_equal(x: Node, y: Node, level: int = None) -> list[Any]: |
| 407 | if x == y: |
| 408 | return [] |
| 409 | if not x._val or not y._val: |
| 410 | return None |
| 411 | if x._val == y._val: |
| 412 | return [] |
| 413 | return x._val.why_equal([y._val], level) |
| 414 | |
| 415 | |
| 416 | class Direction(Node): |