Divide set into subsets with minimum difference in sum
Answers
Answered by
6
Answer:
This is the idea that I have, but I am not sure if this is a correct solution:
1) Sort the array
2) Take the first 2 elements. Consider them as 2 sets (each having 1 element)
3) Take the next element from the array.
4) Decide in which set should this element go (by computing the sum => it should be minimum)
5) Repeat.
⚡Hope it works.⚡
Similar questions
Hindi,
6 months ago
English,
6 months ago
Physics,
11 months ago
Computer Science,
11 months ago
English,
1 year ago