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

10
25/11/1437.py Normal file
View File

@@ -0,0 +1,10 @@
def kLengthApart(self, nums: List[int], k: int) -> bool:
last = -k-1
for i ,x in enumerate(nums):
if x != 1:
continue
if i - last <= k:
return False
last = i
return True