Given a BST and two values p and q that exist in it, return the value of their lowest common ancestor — the deepest node that has both among its descendants (a node may be its own descendant).
Input
p qOutput: the LCA node's value.
6 2 8 0 4 7 9 null null 3 5 2 8
6
6 2 8 0 4 7 9 null null 3 5 2 4
2
An ancestor can be the node itself.
Run your code against the sample tests, or Submit to run the full suite.