Tap here to switch tabs
Problem
Submissions

Problem: Make a Positive Array

med
30 min
Try to solve the Make a Positive Array problem.

Statement

You are given an integer array nums.

An array is considered positive if the sum of every subarray with a length of at least 33 is strictly positive (greater than 00).

In one operation, you can choose any index i and replace nums[i] with any integer.

Return the minimum number of operations required to make nums positive.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Make a Positive Array

med
30 min
Try to solve the Make a Positive Array problem.

Statement

You are given an integer array nums.

An array is considered positive if the sum of every subarray with a length of at least 33 is strictly positive (greater than 00).

In one operation, you can choose any index i and replace nums[i] with any integer.

Return the minimum number of operations required to make nums positive.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9