I wrote my solution recursively. What's the upside to using stacks for the DFS search and summation?
Using iterative or recursive is a good question for any programming languages.
Here is some information on the pros & cons of recursion & iteration in c:
It is not correct to say iterative is better, but in a real interview, it is better for you to know how to solve this problem in both ways.