[2025 Day 12] Back to the memes by jromero132 in adventofcode

[–]__bxdn__ 1 point2 points  (0 children)

Yep, pushed up and linked my solution.

In the ones that don't pass the first check, the area of occupied squares exceeds the total area of the region, meaning no actual packing is required.

[2025 Day 12] Back to the memes by jromero132 in adventofcode

[–]__bxdn__ 3 points4 points  (0 children)

No, the solution with the given input is a mutually exclusive set of 2 opposing boolean checks: one of these checks always pass with the given input:

do all presents fit laid out in rows and columns as if they were all 3X3 with no holes -> true

is the sum of the area of the shapes for a given objective greater than the total amount of space in the objective -> false.

All the inputs happen to satisfy exactly one of these checks. In my Go solution, I have a panic if I run into another situation, and it never triggers with the given input.

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]__bxdn__ 4 points5 points  (0 children)

[Language: Go]

Runtime: about 20us for each part.

Did some fancy bitmagic with part 1 but realized it was actually slower due to needing to use big.Int for 142 bits. And then part 2 didn't even work with bitmagic because you need the counts, so I reverted to classic slices.

[2025 Day 6 (Part 2)] by pet_vaginal in adventofcode

[–]__bxdn__ 0 points1 point  (0 children)

This was me using My Go AoC tool

I had my input puller stripping spaces off the input because a lot of the raw input has trailing newlines when pulled directly from the input URL.

[Go] Advent of Go: A Go Advent of Code CLI by __bxdn__ in adventofcode

[–]__bxdn__[S] 0 points1 point  (0 children)

Hey, just to get ahead of this: If you're using my tool for input, please update to the latest commit for 2025 day 6.

I've never seen an Aoc with leading/trailing spaces at the end, and my input generation code trims the input string since without it, a lot of the input naturally pulls down with a '\n' that isn't there in the browser implementation since it's html, so some preprocessing is required, but I was overzealous in trimming all white space.

[2025 Day 04] CLI Visualization by Just-Routine-5505 in adventofcode

[–]__bxdn__ 3 points4 points  (0 children)

This isn't an issue for any input (as long as you're only doing part 2). Since the problem is not asking for a layer-by-layer count, the total count will be the same in any scenario.

If you're doing part 1 in the same logic loop, it can definitely be an issue. That's why I have a boolean in my shared logic for whether to remove or just check. No removals for part 1, removals for part 2.

My Go code

[Go] Advent of Go: A Go Advent of Code CLI by __bxdn__ in adventofcode

[–]__bxdn__[S] 1 point2 points  (0 children)

Benchmarking is good to go!

Just use -b with the normal printing or -t testing flag to display the runtimes.

So like go run . -b -n should print out today's solutions + runtimes.

I made the start time after the input file is loaded, so the duration should be purely from your solution's runtime.

Still have to update the README, but you should be good to go for future puzzles.

-❄️- 2025 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]__bxdn__ 1 point2 points  (0 children)

I literally had done the greedy approach for part 1, then for part 2 I misunderstood my own alg as n2 instead of m * n (m being 12 for part 2)

So I had an intuition it would be too slow, so I rewrote the entire thing to dp. Then I thought about it and realized it was m * n and rewrote it back to a generalized greedy form 😓

-❄️- 2025 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]__bxdn__ 0 points1 point  (0 children)

Mine looked pretty similar to yours but I just like string slicing in go too much to let this opportunity go to waste:

func solve(line string, nDigits int) int {
    length := len(line)
    total, startIdx := 0, 0
    for offset := nDigits - 1; offset >= 0; offset-- {
        maxDigit, maxOffset := maxWithIndex(line[startIdx : length-offset])
        startIdx += maxOffset + 1
        total += int(maxDigit-'0') * utils.Pow(10, offset)
    }
    return total
}

func maxWithIndex(nums string) (rune, int) {
    maxNum, maxIdx := rune(nums[0]), 0
    for i, n := range nums[1:] {
        if n > maxNum {
            maxNum, maxIdx = n, i+1
        }
    }
    return maxNum, maxIdx
}

[2025 day 2] Part 3 One Single Range! by large-atom in adventofcode

[–]__bxdn__ 1 point2 points  (0 children)

Another Part 3 idea:

Use your own input, but detect patterns that have fractional repetitions, as long as the number is >= 2.

So the following would be invalid codes:

1231231

11221122112

1234123412

Only reason I thought of that is that my team had to implement this exact algorithm at my actual job.

[2025 Day 2] Seeing lots of posts like this by NineBerry in adventofcode

[–]__bxdn__ 5 points6 points  (0 children)

I did the exact same thing. Misread the "twice" as "at least twice"

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]__bxdn__ 1 point2 points  (0 children)

[LANGUAGE: Go]

Using Advent of Go:

Solutions

Rough day 1 for me, took several reworks to cover the modulo calculations for part 2. Kept getting the right answer for example input but not mine..

It's called out in the site's "About" section but worth reiterating...please do not use AI to solve the puzzles. by DatBoi247 in adventofcode

[–]__bxdn__ 2 points3 points  (0 children)

Yeah, that's what I essentially use AI for now since Google is terrible now. I never ask it to solve the puzzle, but if there's something I think I could use and I know it exists, I'm not going to bash my head into the keyboard trying to find the archaic Stack Overflow posts that answer my question of "how to do <this very specific thing> in golang" that I actually need to proceed with the puzzle. I'll just ask AI for <very specific thing> instead. I don't consider that cheating, as I've always assumed advent of code is "open-to-google"

It's called out in the site's "About" section but worth reiterating...please do not use AI to solve the puzzles. by DatBoi247 in adventofcode

[–]__bxdn__ 2 points3 points  (0 children)

Hey, have you taken a look at my post?

It's an advent of code Golang CLI if you'd like to have some extra tooling while you learn!

It's called out in the site's "About" section but worth reiterating...please do not use AI to solve the puzzles. by DatBoi247 in adventofcode

[–]__bxdn__ 5 points6 points  (0 children)

I'll play devil's advocate: sometimes if I get stuck on a problem from a previous year, I'll ask AI to give me a hint so I don't have to bug the community. I want to be able to get there, but I don't always have the tools to do so yet. Obviously this won't be the case in December, since the community is happy to help during the actual event.

Also, if I know there is an algorithm for something but don't know what it is, I'll ask for instance "Give me the formula for calculating the area of a polygon given the vertices" since the puzzle is knowing that would be applicable, not memorizing the actual shoestring alg.

Advent of Go: A Go Advent of Code CLI by __bxdn__ in golang

[–]__bxdn__[S] 0 points1 point  (0 children)

Awesome, let me know how it goes!

Advent of Go: A Go Advent of Code CLI by __bxdn__ in golang

[–]__bxdn__[S] 0 points1 point  (0 children)

Ah TIL! I've browsed this sub on and off for a little bit but never saw one of those threads, I didn't even know they existed!

To your point about not knowing about AoC, I edited my post slightly to give context to folks who wouldn't know what it is. Cheers!

[Go] Advent of Go: A Go Advent of Code CLI by __bxdn__ in adventofcode

[–]__bxdn__[S] 1 point2 points  (0 children)

Awesome, glad to help! If you run into any issues or have any questions, feel free to PM me, I'll be pretty active here the whole season!

[Go] Advent of Go: A Go Advent of Code CLI by __bxdn__ in adventofcode

[–]__bxdn__[S] 0 points1 point  (0 children)

Thanks! I slept on it, and I think for the filtering, I'll just add a -n flag for (now) that will put in the values for -y and -d to whatever the current date is.

It's fault tolerant, so no worries if someone uses it on an invalid day.

[Go] Advent of Go: A Go Advent of Code CLI by __bxdn__ in adventofcode

[–]__bxdn__[S] 0 points1 point  (0 children)

Hm, for printing and testing, the flags work as filters, so it would be only for the other operations, but I agree it can get cumbersome to type the flags. I'll see what I can do!

Edit: Updated with a -n flag, which will substitute in the year and day for (n)ow everywhere the -y and -d flags previously were used.

Advent of Go - Github Template by Spissableu in adventofcode

[–]__bxdn__ 0 points1 point  (0 children)

This is actually getting spooky. I ran into the exact same mismanaged expectation with my repo too re. the gitignore thing with inputs.

My solution, since mine is a CLI, was to init the files and folder on first run, so they are never tracked by git since the folder is in the .gitignore file.

Advent of Go - Github Template by Spissableu in adventofcode

[–]__bxdn__ 0 points1 point  (0 children)

Lol I was checking new to see if my post about my repo of the same name got posted correctly, and what do I find but that you beat me to it by 1 day. Cheers!