This commit is contained in:
2021-12-05 18:52:06 +00:00
parent 7c828a4104
commit 73c49553cc
2 changed files with 28 additions and 15 deletions
+7 -6
View File
@@ -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() {