#3038
Maximum Number of Operations With the Same Score I
pupil · 445 · lc easy +26 · 52.7% accepted · 95 likes · top 43%
Description
You are given an integer array nums. Consider the following operation:
- Remove the first two elements of nums and record their sum as the score of that operation.
Repeat until nums has fewer than two elements. All operations must produce the same score.
Return the maximum number of such operations you can perform.
Code
1
2
3