Pick the fix
Root 1 has only a left child 2. Target is 1. What should the function return?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A False, because the only leaf route is 1 + 2 = 3
Right: the root is not a leaf when it has a child.
The question counts only routes that end where both children are missing.
Why not the others?
- B True, because the root alone is 1. A route must end at a leaf; the root has a child, so it is not one.
- C True, because an empty right side adds 0. Missing children are not leaves.