Hard to understand the dynamtic programming part of Leetcode question 494, Target Sum

后端 未结 0 1376
闹比i
闹比i 2021-01-21 10:15

I found this solution which is extremely fast(beats 99.5%) and space-saving(beats 95%) at the same time. I understand most part, except the line: dp[j]=dp[j]+dp[j-num]

相关标签:
回答
  • 消灭零回复
提交回复
热议问题