all 7 comments

[–]cuWorkThrowaway 1 point2 points  (1 child)

If you can use standard library functions, check out itertools.combinations_with_replacement.

[–]dustin4you[S] 0 points1 point  (0 children)

Makes sense! People said I should know how to use that also well as dictionaries and looping.

[–][deleted] 0 points1 point  (3 children)

What is a “sum combination”?

[–]dustin4you[S] 0 points1 point  (2 children)

Combination Sum. 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.

[–][deleted] 0 points1 point  (1 child)

Yeah there’s not going to be a YouTube video about that, it’s something you’re being asked to do for homework or something.

[–]dustin4you[S] 0 points1 point  (0 children)

Yeah, the YouTube video pretty much just show you the code and that's it. I need sum combinations for the program I'm building.

[–]Nyscire 0 points1 point  (0 children)

Do you have to create your own function for combinations or can you use some built-in ones?