[prev] 56 [next]

Example: Subset Sum

Problem to solve ...

Is there a subset S of these numbers with sum(S)=1000?

 34,  38,  39,  43,  55,  66,  67,  84,  85,  91,
101, 117, 128, 138, 165, 168, 169, 182, 184, 186,
234, 238, 241, 276, 279, 288, 386, 387, 388, 389

General problem:

  • given n integers and a target sum k
  • is there a subset that adds up to exactly k?