about | help | code help+videos | done | prefs |
Given an integer array, return all of the possible sums you could get by picking any number of integers (or none of them) from the array and adding them together.
logic_allPossibleSums([1]) → [0, 1] logic_allPossibleSums([1, 2]) → [0, 1, 2, 3] logic_allPossibleSums([1, 2, 3]) → [0, 1, 2, 3, 4, 5, 6] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy