#3038
Maximum Number of Operations With the Same Score I
easy · 52.7% accepted · 95 likes · top 43%
Description
You are given an array of integers nums. Consider the following operation:
- Delete the first two elements nums and define the score of the operation as the sum of these two elements.
You can perform this operation until nums contains fewer than two elements. Additionally, the same score must be achieved in all operations.
Return the maximum number of operations you can perform.
Solution