add new solutions

This commit is contained in:
kanna5 2026-01-05 16:48:03 +09:00
parent ca24d0a56a
commit 0c73608ce5
Signed by: kkyy
GPG key ID: 06332F3965E9B0CF
36 changed files with 791 additions and 0 deletions

View file

@ -0,0 +1,18 @@
package q3461
func hasSameDigits(s string) bool {
buf := []byte(s)
for i := range buf {
buf[i] = buf[i] - '0'
}
for len(buf) > 2 {
for i := range len(buf) - 1 {
buf[i] = (buf[i] + buf[i+1]) % 10
}
buf = buf[:len(buf)-1]
}
return buf[0] == buf[1]
}
var _ = hasSameDigits