1437. Check If All 1's Are at Least Length K Places Away
Previous1436. Destination CityNext1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Last updated
Last updated
https://leetcode.com/problems/check-if-all-1s-are-at-least-length-k-places-away
Given an array nums
of 0s and 1s and an integer k
, return True
if all 1's are at least k
places away from each other, otherwise return False
.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= nums.length <= 105
0 <= k <= nums.length
nums[i]
is 0
or 1