Create a function using one of the following prototypes:
C++: int findSplits(const int *array, int length);
This function should return the maximum number of sub-arrays which the sum of their elements would all be equals. The array will always have less than 10000 elements.
For example:
findSplits({1,2,3}) 2 [{1,2},{3}]
findSplits({1,2,3,6,12,8,4
,3,3,3,3})
4 [{1,2,3,6}, {12}, {8,4}, {3,3,3,3}]
findSplits({1,2,6,30}) 1 [{1,2,6,30}]
findSplits({1,2,3,4,2}) 2 [{1,2,3}, {4,2}]
Start Free Trial