This commit is contained in:
2025-11-17 17:45:06 +08:00
parent f5ce056f2d
commit 2971e19529
4 changed files with 66 additions and 0 deletions

15
25/11/go/1437.go Normal file
View File

@@ -0,0 +1,15 @@
package C
func kLengthApart(nums []int, k int) bool {
last := -k - 1
for i := 0; i < len(nums); i++ {
if nums[i] != 1 {
continue
}
if i-last <= k {
return false
}
last = i
}
return true
}