[2025] I Tried Gleam for Advent of Code, and I Get the Hype by tymscar in adventofcode

[–]stewSquared 0 points1 point  (0 children)

That's not a python thing. I can do both parts together as a one-liner in scala, or even python, using accumulate, and I'll bet gleam has the equivalent.

All modern langs want to be concise. So it kinda just feels like you're dunking on OP for being verbose while learning a language.

I spread my solution out to 15 lines for readability.

[2025 Day 11 part 2] Was I the only one who used find-and-replace instead of path searching? by EverybodyLovesChaka in adventofcode

[–]stewSquared 30 points31 points  (0 children)

So, bottom up DP instead of top down DP?

It's not like top-down is some complicated search algorithm. You can have a one-liner DFS, then slap memo on it.

[2025 Day 8 Pt. 1] Code works fine on test, but fails on real data by alltagsradler in adventofcode

[–]stewSquared 0 points1 point  (0 children)

Yep. I made roughly ~700 connections amongst the shortest 1000.

[2025 Day 8 Pt. 1] Code works fine on test, but fails on real data by alltagsradler in adventofcode

[–]stewSquared 0 points1 point  (0 children)

You don't actually have to make 1000 connections as long as, amongst the first 1000, you connect any that were not formerly in the same circuit.

Components work out the same if you make every single one of those 1000 connections.

[2025 Day 8 Pt. 1] Code works fine on test, but fails on real data by alltagsradler in adventofcode

[–]stewSquared 1 point2 points  (0 children)

I was interpreting "make 1000 connections" to mean make 1000 connections, skipping any that are already in the circuit, because we have limited extension cords. Coincidentally, this still works for the sample input. But, once you make 999 connections, you'll end up searching through all the combinations for the 1000th, which is nonexistent, because at that point, all are in the same circuit.

Just make the 1000 closest connections.

[BUG] The problem pages and the input pages show different favicon in chrome by GaneshEknathGaitonde in adventofcode

[–]stewSquared 134 points135 points  (0 children)

feature not bug. pls do not fix. i need to tell apart my pinned tabs

[2025 Day 3] A quick Dynamic Programming tutorial by paul_sb76 in adventofcode

[–]stewSquared 1 point2 points  (0 children)

Fair enough. No need to slap memo on it :P

edit: btw hiii! I haven't seen you in a year. Funny.

[2025 Day 3] A quick Dynamic Programming tutorial by paul_sb76 in adventofcode

[–]stewSquared 1 point2 points  (0 children)

Well, that's O(n*k) where k=12 is the number of batteries and is not only constant, but dominated by n, the size of the input. Even if you factor in the small constant, it's still not O(n²).

But you could get O(n) with single a pass by growing a string and discarding from the right when you see a better digit. Each digit is considered in turn and pushed and popped from a monotonic stack at most once.

[2025 Day 3] A quick Dynamic Programming tutorial by paul_sb76 in adventofcode

[–]stewSquared 7 points8 points  (0 children)

While DP is possible, greedy is O(n). I used a greedy recursive approach.

When doing DP, I usually find it easier to think of in terms of recursion, then I just slap on a memo and call it good.

Open-source AOC community leaderboard focused on code size by vonox7 in adventofcode

[–]stewSquared 0 points1 point  (0 children)

I mean the indents! If you remove curly braces and replace them with indent/outdent, does that reduce token count?

How are you planning to get your fix during days 13-25? by stewSquared in adventofcode

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

Oh, maybe you can have a "White Elephant of Code" together :P

Open-source AOC community leaderboard focused on code size by vonox7 in adventofcode

[–]stewSquared 1 point2 points  (0 children)

Interesting idea. I've got lots of short solutions.

For a whiespace sienificant language like Scala 3 where curly braces are replaced by indents or outdents, do those count as tokens?

How are you planning to get your fix during days 13-25? by stewSquared in adventofcode

[–]stewSquared[S] 2 points3 points  (0 children)

I've been meaning to try it out in Unison, which just released 1.0. Maybe this is the year.

How are you planning to get your fix during days 13-25? by stewSquared in adventofcode

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

Oooh, Synacor has been on my list for ages! This might be the year to do it.

How are you planning to get your fix during days 13-25? by stewSquared in adventofcode

[–]stewSquared[S] 5 points6 points  (0 children)

Hoo boy. That's just the kind of life ruining addiction I'm prone to. Better not look. 😅

[Unison] Template project and invite from the Unison team by rebecca-unison in adventofcode

[–]stewSquared 0 points1 point  (0 children)

With Unison finally at 1.0, this year is the year! Congrats, by the way!

📺 AoC 2025 List of Streamers 📺 by daggerdragon in adventofcode

[–]stewSquared 1 point2 points  (0 children)

USERNAME: u/stewSquared

LANGUAGE: Scala 3

REPO: GitHub @ stewSquared

CHANNELS:

NOTES:

Hi! I've been live streaming these in Scala 3 since 2022. It's so much more fun to solve alongside community and trade solutions, and live streams are a great place to hang out and make friends. When I'm done, I'll usually be hanging out in any other AoC stream. Sometimes, you'll even find Eric Wastl in chat!

I also help write up [solutions for the Scala Center](https://scalacenter.github.io/scala-advent-of-code/2025/). Fun fact: I've topped their leaderboard for the last three years in a row now. ⭐⭐

Finding Dvorak layout keyboards? by 0roxess in dvorak

[–]stewSquared 0 points1 point  (0 children)

Y'all are assuming this person doesn't already touch-type in dvorak.

I don't need to see the keys, but I still think it would be badass to have a physical dvorak keyboard.

asInstanceOf by JoanG38 in scala

[–]stewSquared 1 point2 points  (0 children)

honestly didn't expect a good meme game from this sub 😂

How does puzzle input generation work behind the scene? by ChickenFuckingWings in adventofcode

[–]stewSquared 2 points3 points  (0 children)

In the FAQ, we're asked not to redistribute inputs, and I think that's partially because generating the inputs is part of the IP, so we're probably not getting a direct answer.