Ad
  • Custom User Avatar

    Loop through the tree, comparing each node to the sum of its children. When you find a mismatch, you have to figure out which is the wrong value. This can be done by considering different cases. For example, is either of the children not equal to the sum of its children?