title: Lowest Common Ancestor of a Binary Search Tree
body: <p>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?</p>
  
  <pre class="lang-python prettyprint-override">def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
          while (root.val - p.val) * (root.val - q.val) > 0:
              <strong>root = (root.left, root.right)[p.val > root.val]</strong>
          return root
  </pre>