mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-13 02:38:37 +08:00
8 lines
223 B
Python
8 lines
223 B
Python
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 |