You are given a array, such that the sum of all elements of the array is 2n. Write the most efficient algorithm to Partition this array into 2 subarrays such that the sum of these subarrays is exactly n.
Assume that the given array is such that the problem is always solvable
Partition in array into 2 subarrays of equal sums
it can be formulated to knapsack problem, we need to fill the bag such that the bag can have maximum weight of n.