Skip to content

therealjawss/aoc2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advent of Code 2023

Today I learned a valuable lesson on how IEnumerable works.. I was wondering why my solution was taking so long and when I finally stepped through the code, I saw how IEnumerable evaluated multiple times. πŸ˜’ Here is my solution to day 11.

Elapsed time:353 ms
Part 1:9274989
Elapsed time:297 ms
Part 2:357134560737
Elapsed time:81 ms
Part 1:1969958987
Elapsed time:6 ms
Part 2:1068

The day has arrived, it's I love ULONG time! Here is my solution to day 8.

Confession, i do have a Github copilot subscription. I did part 1 with my own sweat and blood but with part two, i did ask copilot to give me the LCM for the list of iterations. Is it cheating? I would say, there really is no cheating in AOC. I mostly see AOC as a way to exercise tools you want to learn how to use.

In a work environment, no one relies on me to know how to implement all the various algorithms there is. Sure it's impressive to be able to do so, but I think knowing when to use them is more important.

Elapsed time:23 ms
Part 1:16531
Elapsed time:12 ms
Part 2:24035773251517

The lesson to READ CAREFULLY was learned today. Wasted a full two hours because I thought we had to weight the entire deck, only to read that we are supposed to process cards in order of appearance. πŸ˜’ Here is my solution to day 7.

I between solving part 1 and part 2, I wanted to use the same method and preserve the behavior for part 1. I took the opportunity to make use of ApprovalTests to verify that I wasn't changing part 1's behavior. I set up regression tests for both parts in hopes that I can refactor them later.

Elapsed time:77 ms
Part 1:253933213
Elapsed time:14 ms
Part 2:253473930

Okay, brute forced this one. Here is my solution to day 5. But will try to get back and improve it later.

Elapsed time:23 ms
Part 1:486613012
Elapsed time:570168 ms
Part 2:56931769

Decided to wing it today, no TDD. Here is my solution to day 4. Will probably clean this up later in the day though.

Elapsed time:12 ms
Part 1:21568
Elapsed time:4 ms
Part 2:11827296

My brain hurt a little.. lots of special cases to consider when parsing 😬 Here is my solution to day 3. Spent too much time on special cases because i didn't realize that regex matches are greedy by default and that they returned indexes. πŸ˜’

Elapsed time:17 ms
Part 1:532331
Elapsed time:6 ms
Part 2:82301120

So far so good.. Here is my solution to day 2. I will be trying to do TDD as much as possible this year.

Elapsed time:17 ms
Part 1:54249
Elapsed time:6 ms
Part 2:54249

Hoping I do better this year, will probably not be able to do it first thing in the morning. We shall see.

Elapsed time:17 ms
Part 1:54249
Elapsed time:6 ms
Part 2:54249

Advent of Code 2022

Today's solution starts using some recursion. No use fighting it, it's going to come eventually.

My solution submitted late because I went for an AW yesterday and today the brain is not working 100%.

This was fairly simple.

Yikes, today was no tdd and there was some manual intervention involved in setting up the stacks 😁 Glad I started with regex yesterday though. Here is my solution to day 5.

TDD is working great so why stop. Also tried to bite the bullet early and start getting some regex action started. Here is my solution to day 4.

Elapsed time:79 ms
Part 1:540
Elapsed time:33 ms
Part 2:872

Thought I would continue yesterdays TDD trend. It was really great to be able to break things down to smaller problems. My solution ended up with methods and functions who only have one job.

Elapsed time:7 ms
Part 1:7597
Elapsed time:6 ms
Part 2:2607

one job

Noteable Solutions

  • Anders and his one liners are always interesting!

Hello bruteforce my old friend. Tried to do a little tdd here but not sure this is the best solution. πŸ€·β€β™€οΈ

Noteable Solutions

  • Anders and his one liners are always interesting!

Nice easy start to advent of code! Improved my batch file a bit to include the year this time. Here is my solution.

Advent of Code 2021

I tried to clever with math but gave up :D so here is brute force.

  • Hex to Bin using linq, switch expressions, too much reading for a 6am activity πŸ€“

Cached recursion finding the lowest risk

Spent way too much time debugging all because i did - instead of +. Meanwhile, i made a batch file to make setup easier.

Day 6

Lantern fish

Day 5

I'm sure there was a math way to solve this... Some good solutions i found through reddit:

Day 4

Well, I tried to get a headstart at using regex but eventually back pedalled and used old reliable string split.

Day 3

Note to self there is a built in binary parser

Convert.Int32("1010101", 2);

Day 2

Tried to use things I learned last year .Aggregate. Started to package some tools as well to simplify getting input, stealing implement from Anders.

Day 1

Was not prepared, so here it is, as is. :) As usual, great solution from Anders https://github.com/lynxz/AdventOfCode/blob/master/2021/Day01/Program.cs Need to start doing using Linq more! Made an update to try to use C# Ranges

Advent of Code 2020

If any christmas needs saving, this one does! www.adventofcode.com

Day 2

Slightly shuddering on basic regex

Day 3

Today I learned a little about .Aggregate, thanks Anders!

Day 4

Eeek. More regex! learned the importance of strict ^...$ but i have to say, MAYBE i'm getting the hang of regex... my webclient reader broke though. need to fix that at some point, for now, copy paste ftw!

Day 5

That was a nice refresher on recursion!

Day 8

missed out updating yesterday, maybe the past few days have been too brutal. Great solutions coming from Anders though!

Day 10

This was really neat https://github.com/FaustVX/adventofcode/blob/master/2020/Day10/Solution.cs

Day 11

Took a long time to find the recursive function for me, literally had to step through a number of iterations. Happy that i was able to refactor and make it work for part 1 as well!

Day 12

Saw this very elegant solution: https://github.com/FaustVX/adventofcode/blob/master/2020/Day12/Solution.cs

Day 13

Officially skipping day 13 part 2... Did TDD and finally came up with the solution! Why didn't I do that first, could have avoided wasting a day! Some solutios to read up on

Day 14

As the problems are getting more difficult, i've decided to do part 1 first thing in the morning before work and then part 2 at the end of the day. So far it is working out. Here are a few solutions i want to study when i have the time:

Day 16

Day 18

Day 20

Day 21

Day 22

Day 23

Day 24

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published