Day 16 solution.
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Takes a slice of strings as from reading each line in a file.
|
||||
// Concatenates strings, creating new ones when blank lines are encountered
|
||||
// NB: adds a single space to the beginning of each concatenated line.
|
||||
@ -19,3 +24,11 @@ func SplitOnBlankLine(input []string) []string {
|
||||
|
||||
return converted
|
||||
}
|
||||
|
||||
func MustAtoi(input string) int {
|
||||
ret, err := strconv.Atoi(input)
|
||||
if err != nil {
|
||||
log.Panicf(err.Error())
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
Reference in New Issue
Block a user