I hate code
This commit is contained in:
parent
3098f26734
commit
a3a27299b6
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -38,7 +39,7 @@ func main() {
|
|||
}
|
||||
}
|
||||
if has == false {
|
||||
fmt.Println("Part 1: ", bad)
|
||||
fmt.Println("Part 1:", bad)
|
||||
break
|
||||
done = true
|
||||
}
|
||||
|
@ -60,7 +61,9 @@ func main() {
|
|||
total += digit
|
||||
}
|
||||
if total == bad {
|
||||
sort.Ints(sl) // a bad bodge
|
||||
fmt.Printf("Part 2: %d\n", sl[0]+sl[len(sl)-1:][0])
|
||||
fmt.Println(sl)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue