3038. Maximum Number of Operations With the Same Score I
Given an array of integers called
nums, you can perform the following operation whilenumscontains at least2elements:
- Choose the first two elements of
numsand delete them.The score of the operation is the sum of the deleted elements.
Your task is to find the maximum number of operations that can be performed, such that all operations have the same score.
Return the maximum number of operations possible that satisfy the condition mentioned above.
1 | class Solution { |