main.go 417 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "math"
  4. )
  5. func main() {
  6. }
  7. func step(start, next []uint64) []uint64 {
  8. for _, stone := range start {
  9. if stone == 0 {
  10. next = append(next, 1)
  11. continue
  12. }
  13. length := uint64(math.Log10(float64(stone))) + 1
  14. if length%2 == 0 {
  15. mod := uint64(math.Pow10(int(length / 2)))
  16. next = append(next, stone/mod, stone%mod)
  17. continue
  18. }
  19. next = append(next, stone*2024)
  20. }
  21. return next
  22. }