Leetcode - Combination Sum (Python) (revisited)

preview_player
Показать описание
October 2020 Leetcode Challenge
Рекомендации по теме
Комментарии
Автор

Blind Curated 75! Great that you went over this problem again. I still fumble trying to come up with the dp solution. I think the time complexity is O(n*target*avg(third for loop)). I'm not sure what the avg(third for loop) is, but i think its n/2. So yeah around O(n^2).

janmichaelaustria
Автор

Question: Where can I read more about this DP array solution strategy you use ?

samarthasthana
Автор

Hi, wanted to understand this part
for l in dp[t-c]:
dp[t].append(l+[c])


Thanks

radhikashroff
visit shbcf.ru