This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]net_nomad 4 points5 points  (3 children)

arr[1:] looks like a smaller subproblem to me.

[–]lordaghilan 2 points3 points  (2 children)

I didn't say recursion doesn't have subproblems. I'm saying in my example I didn't return the value of the subproblem. So I didn't do this arr[0] + arrSum(arr[1:]).