Dynamic programming is a wide category of solutions in which a partial solution is stored in some structure for subsequent subsequent iteration, instead of recounting intermediate results again and again.
If I were to take a dynamic approach to this particular problem, I would probably keep a list of all the calculated amounts from the previous step, as well as the set used to calculate this amount.
, , {null, 7}, 11 , , ( , null+11=11). {null, 7, 11, 18}. , : 7 {7} 18 {7,11}. , A) , B) , . , .
. , , 2^(size of set). , .