easyArraySimulation 0 views

Maximum Number of Operations With the Same Score I

You are given an array of integers nums.

You are given an array of integers nums. Consider the following operation:

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.

Maximum Number of Operations With the Same Score I diagram

Example 1

Input: nums = [3,2,1,4,5]

Output: 2

Example 2

Input: nums = [1,5,3,3,4,1,3,2,2,3]

Output: 2

Example 3

Input: nums = [5,3]

Output: 1

Constraints

  • 2 <= nums.length <= 100
  • 1 <= nums[i] <= 1000

Hints

No hints yet.

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.