package day10 import ( "tools" ) func lookAndSay(look []int) (say []int) { for index := 0; index < len(look); { firstChar := look[index] nextIndex := index + 1 if nextIndex == len(look) { say = append(say, nextIndex-index, firstChar) } else { for len(look) > nextIndex && look[nextIndex] == firstChar { nextIndex++ } say = append(say, nextIndex-index, firstChar) } index = nextIndex } return say } func Part1(puzzle tools.AoCPuzzle) interface{} { look := puzzle.GetInput2DArrayInt()[0] for i := 0; i < 40; i++ { look = lookAndSay(look) } return len(look) } func Part2(puzzle tools.AoCPuzzle) interface{} { look := puzzle.GetInput2DArrayInt()[0] for i := 0; i < 50; i++ { look = lookAndSay(look) } return len(look) }