mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-23 09:51:45 +08:00
11 lines
178 B
Go
11 lines
178 B
Go
package leetcode
|
|
|
|
func prefixesDivBy5(a []int) []bool {
|
|
res, num := make([]bool, len(a)), 0
|
|
for i, v := range a {
|
|
num = (num<<1 | v) % 5
|
|
res[i] = num == 0
|
|
}
|
|
return res
|
|
}
|