LinkedIn Interview Question

Depth sum for nested numbers