package two import ( "bufio" "io" "strconv" ) func parseLines(r io.Reader) ([]string, error) { codes := []string{} scanner := bufio.NewScanner(r) for scanner.Scan() { codes = append(codes, scanner.Text()) } if err := scanner.Err(); err != nil { return nil, err } return codes, nil } func numFromCode(s string) int { n, _ := strconv.Atoi(s[:len(s)-1]) return n }