Datadog Interview Question

sum all the values associated to leaf nodes in a tree