Tap here to switch tabs
Problem
Submissions

Problem: Minimum Increment Operations to Make Array Beautiful

Try to solve the Minimum Increment Operations to Make Array Beautiful problem.

Statement

You are given a 00 indexed integer array nums of length n, and an integer k.

In one operation, you can choose any index i such that $0 \leq i < n and increase nums[i] by 11.

The array nums is considered beautiful if the maximum element in every subarray of size at least 33 is greater than or equal to k.

Return the minimum number of increment operations required to make nums beautiful.

Constraints:

  • 3≤‘n‘==‘nums.length‘≤1053 \leq `n` == `nums.length` \leq 10^5

  • 0≤‘nums[i]‘≤1090 \leq `nums[i]` \leq 10^9

  • 0≤‘k‘≤1090 \leq `k` \leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Increment Operations to Make Array Beautiful

Try to solve the Minimum Increment Operations to Make Array Beautiful problem.

Statement

You are given a 00 indexed integer array nums of length n, and an integer k.

In one operation, you can choose any index i such that $0 \leq i < n and increase nums[i] by 11.

The array nums is considered beautiful if the maximum element in every subarray of size at least 33 is greater than or equal to k.

Return the minimum number of increment operations required to make nums beautiful.

Constraints:

  • 3≤‘n‘==‘nums.length‘≤1053 \leq `n` == `nums.length` \leq 10^5

  • 0≤‘nums[i]‘≤1090 \leq `nums[i]` \leq 10^9

  • 0≤‘k‘≤1090 \leq `k` \leq 10^9