This question evaluates competency in binary tree traversal and path-state accumulation, focusing on the ability to compute sums along root-to-leaf paths while handling edge cases like empty trees and negative values.

You are given the root of a binary tree where each node contains an integer value (may be negative).
Return an array/list containing the sum of values along every path from the root to a leaf (a leaf is a node with no children).
root
: root node of a binary tree.
5
/ \
4 8
/ \
11 4
Root-to-leaf sums are:
[9, 24, 17]
-3
→ output
[-3]