I have an array of length N, let’s say something like:
4 6 4 6 4 6
I need to split this array into P subarrays (in this example, P=3 would be reasonable), such that the sum of the elements in each subarray is s(lets take s=10) : for this ans is {4,6} {4,6} {4,6}
but for this array
3 6 3 6 6 6
there is not any solution. So guys help me out please…