advent-of-code-one-liners
๐๐
One-line Python solutions for Advent of Code 2022 and 2023. (by savbell)
advent-of-code
Advent of Code (by MichaelBrunn3r)
advent-of-code-one-liners | advent-of-code | |
---|---|---|
7 | 7 | |
110 | 1 | |
- | - | |
7.7 | 9.5 | |
5 months ago | 4 months ago | |
Python | Rust | |
- | - |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
advent-of-code-one-liners
Posts with mentions or reviews of advent-of-code-one-liners.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-08.
-
-โ๏ธ- 2023 Day 9 Solutions -โ๏ธ-
Today beats yesterday as my fastest solve! Fairly short too, so I'll include my one-line solutions in-line. q[9] contains the input. Here is my updated visual of the Basilisk, which combines all my one-line solutions into a single, disgusting line of code!
-
-โ๏ธ- 2023 Day 8 Solutions -โ๏ธ-
Here's today's one-liners! Part 1 on line 40 and Part 2 on line 66.
-
-โ๏ธ- 2023 Day 7 Solutions -โ๏ธ-
Day 7 Parts 1 & 2 in a single line of Python (one-liners on lines 60 and 105; multi-line solutions above them).
-
[2023 Days 1-6] [Python] Visualizing the length of the Basilisk, my Python one-liner that solves all the puzzles so far!
This visualization shows the number of characters in my one-line solutions for each part of each day. I actually wrote up a small script to automatically count the characters, calculate their percent of the whole, pick a proportional colour on a rainbow gradient, and save the rainbow line in an SVG file so I can easily use that as the snake's fill colour. This way, I can update the visualization each day as soon as I finish coding the solution. (Don't worry, I won't spam the subreddit with them โ it's just for my own antics!) The automation script is here, if anyone is interested.
-
-โ๏ธ- 2023 Day 6 Solutions -โ๏ธ-
Here's my one-line solution for Day 6, both parts in one, with q[6] as the input file:
-
-โ๏ธ- 2023 Day 5 Solutions -โ๏ธ-
A day late to post, but here is my one-line Python solution for both parts of Day 5! q[5] has the input file contents.
-
Using __import__() for the same package multiple times within the same line of code?
I know that title is scary. But just like last year, I'm trying to solve as many days of Advent of Code in a single line of Python as I can. Because of this restriction, I'm using __import__('re') so I can use RegEx in my solutions rather than using the import statement (since that would add an additional line). But this means I have multiple instances that look like __import__('re').findall(r'\d', l) within a single line (as seen here). My question is: what is the impact of this? Is it importing the module every time it is called, or is it considered fully imported after the first call and just referenced in future calls? Is there any other/better way of doing this?
advent-of-code
Posts with mentions or reviews of advent-of-code.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-07.
-
-โ๏ธ- 2023 Day 8 Solutions -โ๏ธ-
[LANGUAGE: Rust]I was running in circles trying to solve this one.First part was easy enough. I was running into an infinite loop in part 2 and then sadly was spoilered the LCM solution. At least I head fun optimizing the code :)Part 2: I converted the 3 char node names into u16 keys. I store the keys of the left/right successors of each node in a massive array, which I can simply index with they node keys. This proved significantly faster than a HashMap. While converting lines into nodes, I store all keys of nodes ending in an A in a starting nodes array. Next, I calcualte the cycle length for each starting row and then calculating the common LCM. I used rayon to speed things up with multithreading (minor improvement)[Code]
-
-โ๏ธ- 2023 Day 7 Solutions -โ๏ธ-
38.659 ยตs / 41.981 ยตs after removing some allocations and custom input parsing [Code].
- -โ๏ธ- 2023 Day 6 Solutions -โ๏ธ-
- -โ๏ธ- 2023 Day 5 Solutions -โ๏ธ-
- -โ๏ธ- 2023 Day 4 Solutions -โ๏ธ-
What are some alternatives?
When comparing advent-of-code-one-liners and advent-of-code you can also consider the following projects:
advent-of-code-2023-golang
adventofcode2023 - https://adventofcode.com
advent-of-code
advent-of-code-2023
advent-of-code - Solutions to Advent of Code (https://adventofcode.com/)
aoc - Advent of Code solutions
advent-of-code-2023
aoc23
advent-of-code-2023
AoC_23 - Had to create a new one ...
adventOfCode
advent-of-code-one-liners vs advent-of-code-2023-golang
advent-of-code vs adventofcode2023
advent-of-code-one-liners vs adventofcode2023
advent-of-code vs advent-of-code
advent-of-code-one-liners vs advent-of-code-2023
advent-of-code vs advent-of-code
advent-of-code-one-liners vs aoc
advent-of-code vs advent-of-code-2023
advent-of-code-one-liners vs aoc23
advent-of-code vs advent-of-code-2023
advent-of-code-one-liners vs AoC_23
advent-of-code vs adventOfCode