tidy up
This commit is contained in:
+7
-6
@@ -2,13 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const bitSize = 40
|
||||
const bitSize = 12
|
||||
|
||||
func bitComplement(num uint64) uint64 {
|
||||
return ^num & (1<<bitSize - 1)
|
||||
@@ -56,7 +57,7 @@ func partTwo(s []string) (int64, int64) {
|
||||
}
|
||||
|
||||
func solve() {
|
||||
file, err := os.Open("bigboi.txt")
|
||||
file, err := os.Open("input.txt")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -81,10 +82,10 @@ func solve() {
|
||||
total++
|
||||
}
|
||||
|
||||
partOne(&counts, &total)
|
||||
//fmt.Println(int64(g) * int64(e))
|
||||
partTwo(s)
|
||||
//fmt.Println(o * c)
|
||||
gamma, epsilon := partOne(&counts, &total)
|
||||
fmt.Println(int64(gamma) * int64(epsilon))
|
||||
o2, co2 := partTwo(s)
|
||||
fmt.Println(o2 * co2)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user