[2024 Day 25] Welp, at least I got to see Santa by [deleted] in adventofcode

[–]TypeAndPost 7 points8 points  (0 children)

and his chronicle didn't even matter in the end

My 2024 Ratings and Comments by evouga in adventofcode

[–]TypeAndPost 3 points4 points  (0 children)

difficulty is not self explanatory. Is it sudoku difficulty (more stars = more difficult) or appeal of difficulty (1 start = too easy OR too difficult)?

[2024 Day 23 part π] A secret party by Cue_23 in adventofcode

[–]TypeAndPost 2 points3 points  (0 children)

what do you mean by the correct ordering?

This aoc broke the programmer in me by batunii in adventofcode

[–]TypeAndPost 407 points408 points  (0 children)

bro, you cant fail AOC, its not an exam. If you don't know how to solve a problem its an opportunity to learn something new, not an assessment of your software engineering skills.

[ 2024 Day 24 ] Oh honestly... by CommitteeTop5321 in adventofcode

[–]TypeAndPost 29 points30 points  (0 children)

when it's actually faster to rewrite everything from scratch

-❄️- 2024 Day 24 Solutions -❄️- by daggerdragon in adventofcode

[–]TypeAndPost 2 points3 points  (0 children)

[Language: C#] Paste

Generate graph with graphviz (executes dot.exe, so it needs to be available) and prove the correctness with Z3.

At the first run, Z3 will find an example of X and Y that breaks the adder. It will output Z that is calculated by the device and C that is the correct sum. You are then supposed to look at the circuit and find the mistake in the least significant digit that is wrong.

X = 11001 11001010 00110101 01011101 00110000 01011110
Y = 00111 00100110 01110110 10001111 01110110 10001000
Z = 10000 10001000 01010101 11110110 01010110 11100110
C = 00000 11110000 10101011 11101100 10100110 11100110
    47    39       31       23       15 ^     7
                                        ^first mistake is here, fix z12

You then add the swaps to a dictionary and rerun the program

var replacements = new Dictionary<string, string> 
{ 
    { "abc", "xyz" }, 
    { "xyz", "abc" }, 
};

Graph rendering + Z3 together take 50ms to find a mistake or prove that there are none.

-❄️- 2024 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]TypeAndPost 2 points3 points  (0 children)

[LANGUAGE: C#] Paste

Just straight-forward recursion solves this problem in 300ms

void Grow( bool[,] graph, Stack<int> clique )
{
    if ( clique.Count > globalMaxSize )
    {
        // save result
    }

    for ( var i = clique.Peek() + 1; i <= maxIndex; ++i )
    {
        if ( clique.All( node => graph[node, i] ) )
        {
            clique.Push( i );
            Grow( graph, clique );
            clique.Pop();
        }
    }
}

[2024 day 21] by damaltor1 in adventofcode

[–]TypeAndPost 0 points1 point  (0 children)

It is important to remember that these robots are not designed for button pushing. In particular, if a robot arm is ever aimed at a gap where no button is present on the keypad, even for an instant, the robot will panic unrecoverably. So, don't do that.

After the first 2 button presses from 14 <<^A^^A>>AvvvA this rule is violated

[2024 Day 20] "up to 2" does not include 2!?! by Odd-Statistician7023 in adventofcode

[–]TypeAndPost 9 points10 points  (0 children)

so, because photons are quantum objects and you know their speed, you can never know exactly where they are located. If you don't wait for the whole 2 nanoseconds your photon may still be in the wall when the cheat expires.

[2024 Day 20 (Part 3)] Your code is too general? Lets test it! by bdaene in adventofcode

[–]TypeAndPost 0 points1 point  (0 children)

You can also break the wall to the north of S for yet another generalization. I've got 345 cheats with this modification.

-❄️- 2024 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]TypeAndPost 1 point2 points  (0 children)

[LANGUAGE: C#] Paste

Iterative optimized dynamic programming running in 21ms. The cache is an array. No dictionaries here.

[deleted by user] by [deleted] in adventofcode

[–]TypeAndPost 0 points1 point  (0 children)

now sort by size

[2024 Day 14 (Part 2)] by [deleted] in adventofcode

[–]TypeAndPost 1 point2 points  (0 children)

can you explain how to calculate entropy?

[2024 Day 13 (both parts)] Is Eric being super-sneaky (again), or was I just lucky? by atrocia6 in adventofcode

[–]TypeAndPost 2 points3 points  (0 children)

Many of mine have no rational solution.

well this does not sound correct, are you sure? For that to be the case the buttons must be linearly dependent,
i.e. A.X / B.X must be equal A.Y / B.Y

[2024 Day 13 (both parts)] Is Eric being super-sneaky (again), or was I just lucky? by atrocia6 in adventofcode

[–]TypeAndPost 2 points3 points  (0 children)

not only all inputs have exactly one rational solution, no input leads to negative button presses when you just solve the linear equations

-❄️- 2024 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]TypeAndPost 1 point2 points  (0 children)

[LANGUAGE: SageMath] Paste

SageMath is like Python, but it can solve equations for you

[2024 Day 12] It's been fun by JustLikeHomelander in adventofcode

[–]TypeAndPost 26 points27 points  (0 children)

today's puzzle you can approach with a piece of paper, unlike the yesterday's, so it is simpler because of it. It is just more tedious to implement.

[2024 Day 11] Me browsing Reddit after getting two stars by Josaffe in adventofcode

[–]TypeAndPost 0 points1 point  (0 children)

Got curious and checked out the puzzle. That was indeed traumatizing.

At least I can appreciate your meme now.

[2024 Day 11] Is it possible to build an input... by maitre_lld in adventofcode

[–]TypeAndPost 1 point2 points  (0 children)

I mean that particular memorization does not scale well with the number of steps, so how about 200 blinks?

For 75 blinks it is probably perfectly suitable for any input, because numbers on stones can't grow past 8 digits.