Sum to N
Start Timer
0:00:00
Given a list of integers
, and an integer N
, write a function sum_to_n
to find all combinations that sum to the value N
.
Example:
Input:
integers = [2,3,5]
N = 8
Output:
def sum_to_n(integers, N) ->
[
[2,2,2,2],
[2,3,3],
[3,5]
]
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments