mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-12 18:08:38 +08:00
1437
This commit is contained in:
10
25/11/1437.py
Normal file
10
25/11/1437.py
Normal 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
|
||||
Reference in New Issue
Block a user