How to find the smallest subset with a given sum? All elements are integers.

I have an array of integers and I want to find a given sum with the least number of element possible

with both the types

a) Repetition allowed

b) Repetition not allowed

  • $\begingroup$ do you have negatives as well? $\endgroup$ – Navjot Waraich Aug 8 at 6:31
  • $\begingroup$ No only positives. $\endgroup$ – Learner007 Aug 11 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.