From b4665b5bb4b47a8d0fc346e8a2a9ff23e08509b4 Mon Sep 17 00:00:00 2001 From: Nihilazo Date: Thu, 10 Dec 2020 18:40:13 +0000 Subject: [PATCH] the day10 of shame --- day10/main.go | 10 +++++++--- day10/notes | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/day10/main.go b/day10/main.go index 7647d11..196da4e 100644 --- a/day10/main.go +++ b/day10/main.go @@ -6,7 +6,7 @@ import ( "math" "strconv" "strings" - "io/ioutil" + //"io/ioutil" ) func main() { @@ -41,7 +41,11 @@ func main() { if g == 1 { run += 1 } else { - skippable += (run-1) + if run == 2 { + skippable += 2 + } else { + skippable += (run-1) + } run = 0 } } @@ -49,5 +53,5 @@ func main() { fmt.Println(gaps) fmt.Println(skippable) fmt.Println(ints) - fmt.Printf("Part 2: %f\n", math.Pow(2, float64(skippable))-1) // All possible combinations for n, according to wikipedia + fmt.Printf("Part 2: %f\n", math.Pow(2, float64(skippable))) // All possible combinations for n, according to wikipedia } \ No newline at end of file diff --git a/day10/notes b/day10/notes index 5992000..e709bab 100644 --- a/day10/notes +++ b/day10/notes @@ -1,3 +1,5 @@ +I never solved this, I cheated. Here's the notes I made while failing. +###################################################### if the one before and the one after an adapter can connect, that adapter can be dropped find all these possible drops number of possible combinations of these drops