Why does the tag show "Dynamic Programming" for this problem?

  • 0

    The solution is to store accumulated sums into a state vector. But is that really dynamic programming or there is some other solution?

  • 0

    I think the way to computer the sum vector is the simplest dynamic programming example.

    sum[i] = sum[i-1] + nums[i];

    Since you don't sum all the numbers from nums[0] to nums[i].

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.