Combination Sum | LeetCode 39 | Backtracking Algorithm

preview_player
Показать описание
📝Statement: Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different. It is guaranteed that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

✅️BEST RESOURCES FOR SOFTWARE ENGINEERING PREP

✔️EQUIPMENT I USED IN THIS VIDEO:

✴️PRACTICE CODING QUESTIONS

❇️FREE RESOURCE ONLINE

Disclosure: Some links are affiliate links to products. I may receive a small commission for purchases made through these links. #csninja
Рекомендации по теме
Комментарии
Автор

speak in your original accent it makes things more easily understandable

abhaypandey
Автор

The graphic explain is very helpful, this kind of problem is very abstract.

ZhouHaibo
Автор

I think there is a problem in this code that is shown in the video, the bt call inside the for loop must contain 'i' in place of start.

nikhilsoni
Автор

What's the time complexity for DP based solution? Is this better than DP?

harishkandikatla
Автор

Thank you for great explanation. In curr.removeLast() here you remove last element of array, for example one combination is (2, 2, 2, 3) that sum = 9 and remaining will be -1 so here you remove last element of combination (2, 2, 2, 3) ->remove last element (2, 2, 2). Is that correct what I explain?

ehsanhosseini
welcome to shbcf.ru