I understand the algorithm for the iterative approach of finding LCA of a BST. But I do not understand the line below in BOLD. Could anyone please explain to me?
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode': while (root.val - p.val) * (root.val - q.val) > 0: root = (root.left, root.right)[p.val > root.val] return root