Skip to content

derekmwright/aoc-2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2020

Day 1

I got a late start on this and Ruby is my go-to language for get'er done.

I'm thinking I could have used a single functions w/ some recursion but this completed the challenge and it isnt overly complex. To do this recursively I'd have to take into account the number of iterations and the challenge only went to 3, so meh.

Day 2

Still catching up, still Ruby. Made a class for this one, I like it...

Day 3

Recursion! This one was my favorite so far and stumped me for a bit. In my recursion I accidently did an extra assignment that threw off just a couple of the results. But I am very happy with the length of this solution.

Day 4

So, I'll probably just stick with keeping this whole challenge in Ruby. This day's challenge got another Class thrown at it. I had fun setting up the validation logic on it. Overkill for the challenge? Maybe, but it seems to be able to scale and be extensible.

Day 5

Its just binary conversions, this was a quick one. Ruby slice_when comes to the rescue again for partitioning arrays.

Day 6

Lots of text splitting / array manipulation, makes for ugly code. However, its pretty short and gets the job done quickly.

Day 7

Hit a few snags overthinking the recursiveness, reworked and simplified the function quite a few times and then cheated a little and realized I needed to subtract 1 to get rid of the 'shiny bag' count ...sigh.

Day 8

Another fun one, there might have been a shorter way to solve this but I chose the route of making a copy and changing the command index and running the commands for each iteration until I got a success. Works but I havent benchmarked it so it will probably hit the brakes on massive datasets.

Releases

No releases published

Packages

No packages published

Languages