Problem Brief
Maximum Equal Deletion Sum
OA
You have an array A, of size N. There are 3 ways to delete elements:
The array size should be greater than 2, if less, you cannot make any move. The question is to find in how many (maximum) moves, you can get deletion of equal sum.
1Example 1
Input
A = [1, 9, 8, 9, 5, 1, 2]
Output
3
Explanation
You delete:
- first 2 elements (1,9) = 10
- first and last (8,2) = 10
- first and last (9,1) = 10
So, total 3 moves, 3 is the answer.
Constraints
Limits and guarantees your solution can rely on.
ππππ