Our great sponsors
-
Raku 5133/2343, would've been a lot better if I hadn't spent 10 minutes to discover that I used next instead of last in my inner loop.
-
Python 3 part1: https://github.com/martino-vic/Advent/tree/master/day14 got a silver star quite quickly by using nltk's ngrams. Part 2 tripped me up, works only for the easy input but for the proper one it gives me the wrong output, no idea why :/
-
Sonar
Write Clean Python Code. Always.. Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
-
F# Getting used to F# now, simple solution, single loop for Part 1 and 2, not sure how much nested pattern matching is allowed.
-
-
Python 834/852. Part 1. Part 2.
-
-
Rust. I found today surprisingly easy, much better than the last couple -- part 1 was quite simple, just keep a list of the open ones and close them as necessary. Part 2 should have been trivial to implement on top of that, but I wasn't correctly discarding the corrupted lines, and apparently sorting a list and finding the median without off-by-one errors is hard, so that took a while to debug.
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
-
Part 1 - 16 lines
-
I got 4574/3796 and finished both in 31 minutes. Did it in rust, very pleased with myself lol. Link
-
Both parts on github
-
advent-of-code
Collection for all the years of Advent of Code (2017 has its own repo) (by samhclark)
-
Today was very relaxing! The hardest part in part 2 was figuring out how to discard existing lines without ballooning in complexity: Day 10
-
Go, 2815/3818
-
rust
-
Python Full cleaned up version
-
adventofcode
Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022 in Scala (by sim642)
My Scala solution.
-
Perl No stacks, regexps ftw ;)
-
-
Solution in Common LISP. Nice breather after a rough few days :)
-
Solution on Github
-
javascript
-
-
-
-
Solution in Javascript
-
-
Part 1 and part 2 were both structurally similar, involving a stack. The main difference was how I handled newlines.
-
Haskell!
-
-
Part 1
-
Day 10 C#
-
-
C# solution with a straightforward stack-based approach. I modeled sum types using abstract record on line 62 to handle the three different return values from the processing function
-
This one was just too much fun: solution in Rust
-
-
-
AdventOfCode2021
A collection for my Advent of Code (www.adventofcode.com) solutions using Nim, Julia, and Python programming languages (by genius487)
Nim
-
Part 1 and 2
-
Day 10 in Kotlin
-
-
Day 10
-
Part1 and Part2 solution
-
Haskell 3494/3702
-
Clojure, quite happy with this one, simply using a stack and the assumptions we know about the input to easily compare, filter and then match.
-
My day 10 solution in python. The example for part 1 is broken but works for the example input. Pipeline back to passing
-
adventofcode
My collection of Advent of Code solutions in a slightly overkill project setup 🙃👻 (by marcelblijleven)
-
-
-
-
-
-
Advent-of-Code-2021
Made it through all 25 days of Advent of Code for the second time! (by Leftfish)
Anyway, here's my stack-based Python solution. It could be made way shorter because there's actually no need to store data separately about valid lines (valid == not corrupt and empty stack), but I thought the verbose approach makes the solution a bit more understandable.
-
Part 1 Part 2
-
Pretty short stack-based Rust solution.
-
day10.go
-
Rust: https://github.com/ropewalker/advent_of\code_2021/blob/master/src/day10.rs
-
My Rust solution: https://github.com/markus-k/adventofcode/blob/main/day10/src/main.rs
-
* [Part 1 & 2](https://github.com/CodingNagger/advent-of-code-2021/blob/master/src/main/java/com/codingnagger/days/Day10.java)
-
-
-
Day 10, Part A
-
All of 2021 so far: Single jupyter notebook
-
github
-
GitHub for logic. See also Day10 Task for getting the answer.
-
Python 3, both parts on github.
-
GitHub Part 1 | GitHub Part 2
-
-
Quite happy with the result of today's puzzle! Had to implement my own hacky stack but it was quite doable, did not miss python that much this time around :p
-
My solution in Python, using a stack to keep track of my needs for closure.
-
I probably should've done. The syntax for that isn't quite as nice in Perl as in Raku. My thinking was that ‘middle’ is ‘median’ and we already did that, so it's just a single line a quick ack on this year's code will instantly find. I wasn't expecting it to start sticking pesky commas in there!
-
Cool! I decided to learn Go, too. Went with strings.Index Pt1 , Pt2
-
Easy! Solved using pattern matching: y2021/day_10.ex
-
Part 1 Part 2
-
Solution using Stack in C#
-
Here's some sauce, and there's some thoughts (not very interesting this time).
-
Part1 and part2 in Javascript
-
Source
-
ungolfed
-
c# Solution
-
-
It took me a loooong time to even understand what the problem said but once I did the solution was pretty easy! (in Python)
-
Java. Github
-
Elixir Quite a fun little exercise today. Code is still ugly as death, but I finally feal like I can enjoy the language freely. On other note, how could I solve the problem with me having to push char at the amstart of array without overloading process_line/2 ? (Line 5)
-
-
Hopefully fairly readable code. Nothing radical, I used a stack like most other people. This and my solutions from previous days are on Github
-
C#
-
My solution in Clojure. That was pretty easy for me, even though I'm still beginner!
-
Blog
-
-
GitHub link
-
Scala. Used tail recursion and a closure for both parts. Used a List as my stack to utilize the O(1) complexity for head operations.
-
-
-
-
aoc-2021
My Solutions to Advent of Code 2021 ( https://adventofcode.com/ ). I don't know which languages i'll use yet, probably some C, some Rust, some Python and maybe some C++ (by CaptainJack42)
Rust solution using a FIFO-Queue.
-
GitHub link
-
GitHub
-
Python - Happy that the deque fit part two.
-
Using a parser for part 1: See here
-
Fairly straight forward, part 2 below. Just used a stack to keep track of the closing characters that I'm expecting to see. At the end of the line, score the remaining characters in the stack.
-
-
Solution in Rust
-
-
-
-
Yep. Boring straightforward stack usage. Why settle for anything more?
-
-
code
-
-
-
GitHub/NavigationSyntax.java
-
-
-
-
C# At first the description was confusing to me, but after doing the first part the second was easier. One tiny thingy I find funny is my solution needs to Reverse() the added symbols, because using creating new stack from another puts them the symbols in the new one in different order. GitHub
-
My Kotlin solution: [paste], [repo]
-
Quick and dirty solutions for Part 1 and Part 2.
-
-
-
Time for recursion and pretending-a-list-is-a-stack! (Source and tests)
-
advent-of-code-go
All 8 years of adventofcode.com solutions in Go/Golang; 2015 2016 2017 2018 2019 2020 2021 2022
-
-
-
-
-
See https://github.com/golang/go/wiki/SliceTricks for more fun with slices...
-
The two scorer functions live on Github.
-
Here's my solution in F# with Jupyter Notebook. Used a recursive solution with a List as a stack.
-
-
Day 10 in F#, getting got hold of the fold function :) day10.fsx
-
Java if you are interested.
-
Ruby; the hardest part of this was figuring out what exactly constituted "corrupt" vs. "incomplete." Spent way too much time trying to do an arduous recursive algorithm until I realized I had the problem wrong and I could just do the stack thing that I'd even seen before. Part 2 was weirdly easy once I got that.
-
T-SQL
-
I've done something similar to this in Python before, but this time the completion aspect did throw a little wrinkle into it. That taught me some new stuff about slices, sorting, and idiomatic implementations of a stack in Go. Full source including tests available on Github.
-
Python solution only took me about an hour and that included typing, writing unit tests, etc.
-
I've got a similar yet different solution! I used a few helper function that are really match statements, plus a filter-map with a special case in the "return None;" branch and a sort. https://github.com/PurpleMyst/aoc-2021/blob/dc9feb525d3a13558b879468831b43ff103357ab/day10/src/lib.rs
-
-
-
Rust
-
Kotlin solution. I converted them to numbers ( like round brackets would be 1 and -1 ), and then just used the numbers to work with.
-
Kotlin
-
kotlin solution, uses ArrayDeque, not bad
-
-
-
-
-
-
-
AdventOfCode2021
Advent of Code 2021 challenge: 13 different languages, one chosen at random every day! (by Qualia91)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives