--- Day 25: Locks ---

December 25

Listening to: christmas lofi radio 🎄cozy beats to get festive to


Incompetent elves, always. I wonder how many of these problems could exist if the elves were halfway decent at their jobs in the first place?

private List<int> ParseKey(List<string> input)
{
    var key = new List<int>(5);
    for (int i = 0; i < 5; i++) key.Add(0);
    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
        {
            if (input[i][j] == '#') key[j]++;
        }
    }

    return key;
}

private bool DoesKeyFit(List<int> tumbler, List<int> key)
{
    for (int i = 0; i < 5; i++)
    {
        if (tumbler[i] + key[i] > 5) return false;
    }

    return true;
}

Anyway, this year was kinda fun! It felt a LOT easier this year, in part because I understand C# way more than I did C++ (having used it in my day job for years), but also in aprt because I bothered making a bit of an actual utility library for myself, as well as just generally able to leverage LINQ a lot more. It feels a bit like cheating, but most modern languages have similar capabilities (even C++ has a lot of libraries avaliable that can do that, I just didn't use any before).

I didn't find the story as compelling this year, as it felt like a bunch of disjointed stories, vs a more compelling full journey in previous years. But it was still enjoyable.


Time taken: 20 minutes

My solutions for today's puzzles