Problem · Dynamic Programming
Maximum Equal Deletion Sum
Learn this problemProblem statement
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.
Function
maximumEqualDeletionSum(A: int[]) → intExamples
Example 1
A = [1, 9, 8, 9, 5, 1, 2]return = 3You 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
🍋🍋🍊🍊More Microsoft problems
- Authentication SystemOA · Seen Jul 2026
- Binary String Swap TimeOA · Seen Jul 2026
- Minimum Effort Task ScheduleOA · Seen Jul 2026
- Maximum Pipeline ThroughputOA · Seen Jul 2026
- Maximum Strong Team SubarrayOA · Seen Jul 2026
- Minimum Cost K-Capable ModelsOA · Seen Jul 2026
- Alphabetically Smallest PalindromeOA · Seen Jul 2026
- Maximum Reward PointsOA · Seen Jul 2026