the day10 of shame
This commit is contained in:
parent
ba6e3749f5
commit
b4665b5bb4
|
@ -6,7 +6,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"io/ioutil"
|
//"io/ioutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -41,7 +41,11 @@ func main() {
|
||||||
if g == 1 {
|
if g == 1 {
|
||||||
run += 1
|
run += 1
|
||||||
} else {
|
} else {
|
||||||
skippable += (run-1)
|
if run == 2 {
|
||||||
|
skippable += 2
|
||||||
|
} else {
|
||||||
|
skippable += (run-1)
|
||||||
|
}
|
||||||
run = 0
|
run = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,5 +53,5 @@ func main() {
|
||||||
fmt.Println(gaps)
|
fmt.Println(gaps)
|
||||||
fmt.Println(skippable)
|
fmt.Println(skippable)
|
||||||
fmt.Println(ints)
|
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
|
||||||
}
|
}
|
|
@ -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
|
if the one before and the one after an adapter can connect, that adapter can be dropped
|
||||||
find all these possible drops
|
find all these possible drops
|
||||||
number of possible combinations of these drops
|
number of possible combinations of these drops
|
||||||
|
|
Loading…
Reference in New Issue