I do not know to search or google, so I ask him here. I have an array of integers with a fixed size and it is with this logic.
sample [1,2,4,8,16,32]
Now I am assigned a number, for example 26. And I will find numbers the sum of which will be this number, in this case [2,8,16]
for the number 20 it will be [4.16]
for 40 it is [8.32]
and for 63 all these numbers [1,2,4,8,16,32]
What is the correct algorithm for this?
I know for sure that there is always a continuation, that the number doubles from the previous value. as well as only numbers from a given array are summed with a given number, and each number will be used only once or not
#, ints int ints, int, , .