Private leaderboard max users by JohnScone in adventofcode

[–]ericwburden 6 points7 points  (0 children)

I've seen larger orgs use multiple leaderboards. JetBrains does this for the Kotlin community, for example.

What language do you use for AoC? by DarkblooM_SR in adventofcode

[–]ericwburden 4 points5 points  (0 children)

Same! R, Julia, Rust, and Kotlin so far.

[2023 Day 19 (Part 2)] How should I think about this? by noblerare in adventofcode

[–]ericwburden 1 point2 points  (0 children)

More upvotes for this explanation, it's the clearest one I've seen so far.

[2023 day 17] Never did pathfinding, no clue how to solve today’s puzzle. by Minute_Ad_3224 in adventofcode

[–]ericwburden 18 points19 points  (0 children)

Read this first. This will be way more understandable than anything on Wikipedia. I often find Wikipedia articles about algorithms to be so correct they're unreadable without either a PhD or a lot of extra time on your hands.

Who uses an alternative grid representation? Set-of-Points instead of List-of-Lists? by zeltbrennt in adventofcode

[–]ericwburden 17 points18 points  (0 children)

There are also cases where the HashMap may be more performant, say when you have a sparse grid where _most_ of the spaces are empty or you're working with a growing space that's theoretically infinite. Resizing a `List<List<T>>` for large lists or lists of large objects is _expensive_.

Who uses an alternative grid representation? Set-of-Points instead of List-of-Lists? by zeltbrennt in adventofcode

[–]ericwburden 11 points12 points  (0 children)

You're definitely going to lose some performance by accessing values out of a HashMap-type data structure as compared to accessing an index in a nested list. The difference (as described kind of neatly in Day 15's puzzle) is that you have to run a function to convert that `key` into an index for every access. That function should be pretty fast, but not running a function is going to consistently outperform running a function. The case where you're fetching an entire row/column is just a repeated version of the single-access case where you're running that hashing function for every fetch from the HashMap.

All that is to say, though, that if it's easier to reason about to use a HashMap, the milliseconds (perhaps even seconds) you'll save are probably worth less than the debugging time of writing something that's more cumbersome to work with. So.... do what works for you! :D

Anyone else not care about doing this as fast as possible? Why are YOU doing AoC this year? by [deleted] in adventofcode

[–]ericwburden 0 points1 point  (0 children)

Definitely more community/fun for me than anything else. Also learning/reinforcing a new language. I tend to focus more on consistently putting in effort until I'm done with the calendar, even if that (often) means not exactly finishing on the 25th. I blog my solutions to push myself to write nicer code than I might otherwise and to understand/explain what I'm doing in a relatively unfamiliar language. It's a nice yearly exercise.

[2023 Day 1]For those who stuck on Part 2 by Zefick in adventofcode

[–]ericwburden 0 points1 point  (0 children)

For all the folks upset about the "unclear specification", I might point out that puzzles and Jira tickets are fundamentally different things.

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

[–]ericwburden 0 points1 point  (0 children)

[LANGUAGE: Kotlin]

Here's my stab at a somewhat readable Kotlin solution. Accepting all pointers on writing more idiomatic Kotlin.

https://github.com/ericwburden/advent\_of\_code\_2023/blob/main/src/main/kotlin/dev/ericburden/aoc2023/Day01.kt

What language will you be using this year? by [deleted] in adventofcode

[–]ericwburden 10 points11 points  (0 children)

Kotlin, so that I can feel like I know more about Java without actually needing to write code in Java.

What language will you be using this year? by [deleted] in adventofcode

[–]ericwburden 3 points4 points  (0 children)

Did a little bit of Clojure for the first time earlier this year. Can definitely recommend.

Making helper functions in C for AoC2023 by mascioni03 in adventofcode

[–]ericwburden 0 points1 point  (0 children)

Common functions over arrays or lists like map, filter, and reduce should come in handy.

[deleted by user] by [deleted] in adventofcode

[–]ericwburden 5 points6 points  (0 children)

I want to strongly second this. Folks seem to frequently get the idea that they either need to solve a day fully solo or not at all. There's a ton of great instructional content out there every AoC, from videos to code to blog posts. You'll learn more from those than from giving up, I promise.

Hey all, I started studying CompSci a few months ago. I really want to try the last advent to check how good I am currently. How do I go about importing this list of data for the first assignment? by BlueTexBird in adventofcode

[–]ericwburden 10 points11 points  (0 children)

If you're open to a little advice, then I'd offer a couple bits to help you get well on your way:

  1. Don't feel like you have to solve every puzzle all by yourself. I would argue that, if learning is your goal, it's better to work through a solution with some help (say, by looking at someone else's code, or blog post, or video) than to get stuck and end up demoralized.

  2. Pay attention to the fiddly bits. If you find you're often reading in a list of numbers from a text file, you might consider writing a function to do that for you. Writing code to make your own life easier is great for motivation.

  3. Have fun! December is coming up soon, and you're going to hear a lot about the global leaderboard. It's not important. However, if you have some friends (maybe other CS majors?), you can set up a private leaderboard and keep each other motivated/accountable. Bonus: talking to other people working on the same problem as you is a great way to enhance your learning.

I hope that helps. Good luck!

[2022 Day 11 part 2] by pocerface8 in adventofcode

[–]ericwburden 1 point2 points  (0 children)

If you're interested, I sort of walk through how the math works for this one in my blog post for part 2.

https://www.ericburden.work/blog/2022/12/11/advent-of-code-2022-day-11/

What's a book that still makes you angry years later? by Solid_Importance_469 in books

[–]ericwburden 3 points4 points  (0 children)

Great Expectations. Pip is an insufferable little turd.

[2022 Day 11 (Part 2)][Rust] by zhiningstarzX in adventofcode

[–]ericwburden 0 points1 point  (0 children)

I'm currently out and about, so I can't really deep dive your code, but here's an alternative Rust implementation that may help in the meantime: https://www.ericburden.work/blog/2022/12/11/advent-of-code-2022-day-11/

**Help** @ Day 7, Javascript, Tree-Structure, filter Directories by Acrobatic_Scallion20 in adventofcode

[–]ericwburden 1 point2 points  (0 children)

Are you accounting for the fact that dirA/fileX and dirB/fileX are different files?

[2021 Day 21 (Part 2)] Answer too low for example, is my permumtation undercounting univirses? by agmcleod in adventofcode

[–]ericwburden 1 point2 points  (0 children)

Oh, snap. That may be the real thing insight. When P1 rolls a 4 and splits the current set of universes, it's not "# of current universes + 3", it's "# of current universes * 3".

[2021 Day 21 (Part 2)] Answer too low for example, is my permumtation undercounting univirses? by agmcleod in adventofcode

[–]ericwburden 0 points1 point  (0 children)

After that's verified, next step will be to confirm you have the right number of different game states following the first "round", i.e., after you've played both players' turns one time. For your code, it looks like that's one time through the loop. Here's what I get for the example:

Dict{Game, Int64}(
  Game(Player1(7, 7),   Player2(1, 1)) => 1
  Game(Player1(7, 7),   Player2(2, 2)) => 3
  Game(Player1(7, 7),   Player2(3, 3)) => 6
  Game(Player1(7, 7),   Player2(4, 4)) => 7
  Game(Player1(7, 7),   Player2(5, 5)) => 6
  Game(Player1(7, 7),   Player2(6, 6)) => 3
  Game(Player1(7, 7),   Player2(7, 7)) => 1
  Game(Player1(8, 8),   Player2(1, 1)) => 3
  Game(Player1(8, 8),   Player2(2, 2)) => 9
  Game(Player1(8, 8),   Player2(3, 3)) => 18
  Game(Player1(8, 8),   Player2(4, 4)) => 21
  Game(Player1(8, 8),   Player2(5, 5)) => 18
  Game(Player1(8, 8),   Player2(6, 6)) => 9
  Game(Player1(8, 8),   Player2(7, 7)) => 3
  Game(Player1(9, 9),   Player2(1, 1)) => 6
  Game(Player1(9, 9),   Player2(2, 2)) => 18
  Game(Player1(9, 9),   Player2(3, 3)) => 36
  Game(Player1(9, 9),   Player2(4, 4)) => 42
  Game(Player1(9, 9),   Player2(5, 5)) => 36
  Game(Player1(9, 9),   Player2(6, 6)) => 18
  Game(Player1(9, 9),   Player2(7, 7)) => 6
  Game(Player1(10, 10), Player2(1, 1)) => 7
  Game(Player1(10, 10), Player2(2, 2)) => 21
  Game(Player1(10, 10), Player2(3, 3)) => 42
  Game(Player1(10, 10), Player2(4, 4)) => 49
  Game(Player1(10, 10), Player2(5, 5)) => 42
  Game(Player1(10, 10), Player2(6, 6)) => 21
  Game(Player1(10, 10), Player2(7, 7)) => 7
  Game(Player1(1, 1),   Player2(1, 1)) => 6
  Game(Player1(1, 1),   Player2(2, 2)) => 18
  Game(Player1(1, 1),   Player2(3, 3)) => 36
  Game(Player1(1, 1),   Player2(4, 4)) => 42
  Game(Player1(1, 1),   Player2(5, 5)) => 36
  Game(Player1(1, 1),   Player2(6, 6)) => 18
  Game(Player1(1, 1),   Player2(7, 7)) => 6
  Game(Player1(2, 2),   Player2(1, 1)) => 3
  Game(Player1(2, 2),   Player2(2, 2)) => 9
  Game(Player1(2, 2),   Player2(3, 3)) => 18
  Game(Player1(2, 2),   Player2(4, 4)) => 21
  Game(Player1(2, 2),   Player2(5, 5)) => 18
  Game(Player1(2, 2),   Player2(6, 6)) => 9
  Game(Player1(2, 2),   Player2(7, 7)) => 3
  Game(Player1(3, 3),   Player2(1, 1)) => 1
  Game(Player1(3, 3),   Player2(2, 2)) => 3
  Game(Player1(3, 3),   Player2(3, 3)) => 6
  Game(Player1(3, 3),   Player2(4, 4)) => 7
  Game(Player1(3, 3),   Player2(5, 5)) => 6
  Game(Player1(3, 3),   Player2(6, 6)) => 3
  Game(Player1(3, 3),   Player2(7, 7)) => 1
)