Dividing an array into two sets with minimum difference

Revision en1, by Death_Scythe, 2016-10-15 07:29:45

Hi all!

I don't have the exact problem statement, it was asked in one of the coding tests for an interview but I think I remember the problem quite well.

Given an array of n values, we have to make two sets such that size of first is at most k and size of second is at most s. The difference of sum of values in first set and sum of values in second set is minimum. I need to find this minimum value.

Constraints: n<=200, k,s<=100, 0<values in array<=1000

Please let me know if something is unclear.

Thanks!

Tags array, c++, dynamic programming

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Death_Scythe 2016-10-15 09:12:10 31 Tiny change: 'value.\n\nConst' -> 'value.\n\nThe sets must be non-empty.\n\nConst'
en1 English Death_Scythe 2016-10-15 07:29:45 578 Initial revision (published)