2772. Apply Operations to Make All Array Elements Equal to Zero
You are given a 0-indexed integer array
numsand a positive integerk.You can apply the following operation on the array any number of times:
- Choose any subarray of size
kfrom the array and decrease all its elements by1.Return
trueif you can make all the array elements equal to0, orfalseotherwise.A subarray is a contiguous non-empty part of an array.
1 | class Solution { |