Minimum subset size for target sum.

Revision en1, by v0rtex, 2021-10-21 12:00:36

An array of size N is given and a value K. You have to find the minimum subset size so that subset sum is exactly equal to K, if not print -1. 0 < K, a[i], N < 10^6.

Tags subset sum, 0/1 knapsack, minimum

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English v0rtex 2021-10-21 12:00:36 200 Initial revision (published)