iusetabs / advent-of-code-22-go

Solutions to AoC 22 in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code 2022: Go

I am a noob to Go! This year I want to use the AoC as an excuse to play with language. Hopefully my code doesn't make those experienced with Go queasy! 😉

Go Unicorn

To see more Go AoC solutions, check out this awesome collection of repos!

Day 1 Challenge | Day 1 Source Code

Day 2 Challenge | Day 2 Source Code Using If & Else's | Day 2 Source Code Using Maps

At first I thought I wrote a shitty solution with a bunch of if and else statements. So I wrote one using maps and it really reduced the amount of lines of code. However using go test benchmarking, I noticed the if else solution is much faster! I would be curious to try it with slices to see where this falls. So sometimes if else's might be more optimal, even if it's ugly! 😉

Screenshot of benchmarking

Day 3 Challenge | Day 3 Source Code

Day 4 Challenge | Day 4 Source Code

Day 5 Challenge | Day 5 Source Code

Day 6 Challenge | Day 6 Source Code

Day 7 Challenge | Day 7 Source Code

Day 8 Challenge | Day 8 Source Code

About

Solutions to AoC 22 in Go


Languages

Language:Go 97.4%Language:Shell 2.6%