mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-12 18:08:38 +08:00
1018
This commit is contained in:
8
25/11/1018.py
Normal file
8
25/11/1018.py
Normal file
@@ -0,0 +1,8 @@
|
||||
class Solution:
|
||||
def prefixesDivBy5(self, nums: List[int]) -> List[bool]:
|
||||
ans = []
|
||||
num = 0
|
||||
for v in nums:
|
||||
num = ((num << 1) + v) % 5
|
||||
ans.append(num == 0)
|
||||
return ans
|
||||
Reference in New Issue
Block a user