Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

Minimum sum partition problem in JAVA, C++, Python and C

Open dhruvmillu opened this issue 1 year ago • 2 comments

Minimum sum partition problem

Given a set of integers, the task is to divide it into two sets S1 and S2 such that the absolute difference between their sums is minimum. If there is a set S with n elements, then if we assume Subset1 has m elements, Subset2 must have n-m elements and the value of abs(sum(Subset1) – sum(Subset2)) should be minimum.

image

Example

Input:  arr[] = {1, 6, 11, 5} 
Output: 1
Explanation:
Subset1 = {1, 5, 6}, sum of Subset1 = 12 
Subset2 = {11}, sum of Subset2 = 11    

Solution

Will provide the solution for Minimum sum partition problem in Java, Python, C and C++ will proper comments and documentation.

I would like to work on this issue. Could you please assign this issue to me under SSoC ' 23.

dhruvmillu avatar May 30 '23 12:05 dhruvmillu

Assigned! @dhruvmillu : C, C++, Python and Java

Kumar-laxmi avatar May 30 '23 15:05 Kumar-laxmi

I would like to work on this issue, kindly assign this to me.

Tanyamodi avatar Jul 14 '23 05:07 Tanyamodi

This issue has been automatically closed because it has been inactive for many days. Please reopen if you still intend on working on this problem

github-actions[bot] avatar Aug 17 '24 16:08 github-actions[bot]