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