Lowest Common Ancestor of a Binary Tree Solutions in PythonNumber 236Difficulty MediumAcceptance 45.8%Link LeetCodeOther languages C++, Java, GoSolutionsPython solution by haoel/leetcodedef lowestCommonAncestor(self, root, p, q): if root in (None, p, q): return root left = self.lowestCommonAncestor(root.left, p, q) right = self.lowestCommonAncestor(root.right, p, q) return root if left and right else left or rightdef lowestCommonAncestor(self, root, p, q): if root in (None, p, q): return root left = self.lowestCommonAncestor(root.left, p, q) right = self.lowestCommonAncestor(root.right, p, q) return root if left and right else left or right