16682
A family is about to break their piggy bank to use the
money
different purposes. The piggy bank here
represents an array (arril) consisting of N coins. The
family has to split the coins of piggy bank into smaller
Ostack (sub-array) of coins such that the sum of the
difference between the maximum value and the
minimum value of the coins for all the stacks (sub-
arrays) is maximum.
Note:
Each value of the array can be used only once that is only
in one sabarray.
4948311608
Constraints:
49,=N<=500
1<=arr[i]<=100
494831160 82
494831160
Example 1:
Input:
5
{8,1,7,9,2}
Value of N
→ arri), elements from arr[0] to arr[N-1],
doch element is d
by new line
494831160
Data.
Answers
Answered by
0
Answer:
help him with money
Explanation:
sharing is caring
Similar questions