1234567891011121314151617181920212223242526 |
- package main
- import (
- "math"
- )
- func main() {
- }
- func step(start, next []uint64) []uint64 {
- for _, stone := range start {
- if stone == 0 {
- next = append(next, 1)
- continue
- }
- length := uint64(math.Log10(float64(stone))) + 1
- if length%2 == 0 {
- mod := uint64(math.Pow10(int(length / 2)))
- next = append(next, stone/mod, stone%mod)
- continue
- }
- next = append(next, stone*2024)
- }
- return next
- }
|