I found a time machine under my sofa and apparentl...
# advent-of-code
p
I found a time machine under my sofa and apparently it took me back to the first of December 2020. 🕛 K Has someone an idea how to deduplicate the permutation logic of the functions permutations2 and permutations3? https://github.com/PaulWoitaschek/AdventOfCode/blob/main/src/main/kotlin/de/woitaschek/aoc/year2020/Day1.kt
e
one big hint is that you don't actually need `permutations3`…
p
What's wrong with it? You mean I could first sum one permutation and then do it again with the original input?
e
if you're ok with spoilers,
p
Yeah it's fine I already solved it and it runs within a few ms
e
given
x+y+z=2020
, after choosing
x
and
y
, you don't need to iterate over anything to find
z
a
@ephemient has to be an AI, he see to quickly optimisation 😂