Fundamentals/Partition array into N subsets with balanced sum
← PrevNext →
Given a sorted array, please place them into N buckets, ensuring we get N subarrays with approximately equal weights.
Example 1
Inputarr = [1, 2, 3, 4, 5], N = 3
Output[[5],[1,4],[2,3]]