236. Lowest Common Ancestor of a Binary Tree
Use the tabs to read the prompt, implementation, and tests separately. Syntax uses Shiki; tests can be executed on the server with node --test.
Same file as in the repo · ~20s timeout
From file header (JSDoc)
236. Lowest Common Ancestor of a Binary Tree
@param {import('../../lib/tree-node.js').TreeNode | null} root
@param {import('../../lib/tree-node.js').TreeNode} p
@param {import('../../lib/tree-node.js').TreeNode} q
@returns {import('../../lib/tree-node.js').TreeNode | null}