This commit is contained in:
2025-11-24 14:51:42 +08:00
parent e921762ca4
commit e030df06c9
3 changed files with 15 additions and 32 deletions

View File

@@ -1,5 +1,11 @@
package D
func prefixesDivBy5(nums []int) []bool {
ans := make([]bool, len(nums))
num := 0
for i, v := range nums {
num = ((num << 1) + v) % 5
ans[i] = num == 0
}
return ans
}