UBER OA Question

Q. Divide the array into two parts, such that the difference between the sums of these two parts is minimized and the numbers of elements in these two parts differ by at most 1.

Constraints:
Number of TestCases: 50
Size of array: 1 <= n <= 200

An easier version of the problem is without the size of partitions constraint. How to solve this one?

Comments (8)