about | help | code help+videos | done | prefs |
nCombinationsAddingTo
Define a function that when passed an integer array (say, data) an integer (say, target), and the starting index (say, idx), returns the number of combinations in which zero or more items of the array starting at idx can be added together to construct the target. nCombinationsAddingTo([10, 70, 20, 90], 90, 0) → 2 nCombinationsAddingTo([1, 2, 3, 4, 5, 6], 10, 0) → 5 nCombinationsAddingTo([], 0, 0) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 5 Post-solution available
Copyright Nick Parlante 2017 - privacy