Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Advent_of_Code_2023
My attempt for Advent of Code 2023. Will try in Python first, Rust if/when I have time. (by ray10k)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
AdventOfCode
Hacky solutions for [Advent of Code](https://adventofcode.com), working on past problems (by AllanTaylor314)
-
advent-of-code-2023
Discontinued Doing every day of advent of code in a different programming language! (by JJWRoeloffs)
-
Pike
Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation. (by pikelang)
-
aoc-2023
C++17 solutions to the Advent of Code 2023 coding puzzles (https://adventofcode.com/2023). (by charlescochran)
-
advent-of-code-2023
Solutions to Advent of Code 2023 puzzles https://adventofcode.com/2023 (by Lysander6)
-
aoc-2023
Discontinued My Advent of Code 2023 Solutions [Moved to: https://github.com/AJMansfield/aoc] (by AJMansfield)
-
AoC2023-python
My Python solutions for the Advent of Code 2023 event (https://adventofcode.com/2023)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
I think you meant to link to this Solution ;)
For some reason I really struggled with part 2, originally going down the route of keeping a stack/queue. After a few hours I was too tired and used this solution for reference by u/LastMammoth2499, and now it makes sense:
[Language: Swift] (code)
My solution: https://github.com/LinAGKar/advent-of-code-2023-rust/blob/master/day4/src/main.rs
github
Both parts
[LANGUAGE: Python]
GitHub
Code: main (5f0a9a8)
For more days pointlessly made into one-liners check out my GitHub
Full code is available on my github: Day04.scala Used a map in P2 to memoize how many total cards you get from a given card.
Github for all days
Code: https://github.com/akashdeepnandi/advent-of-code/blob/main/day4/index.js
[LANGUAGE: Go] Enjoyed this one GitHub
[Language: Elixir] https://github.com/mathsaey/adventofcode/blob/master/lib/2023/4.ex
[Language: C#] Today very clean one https://github.com/dr124/advent-of-code/blob/master/Advent._2023/Week1/Day4.cs
[LANGUAGE: Python] https://github.com/kenan238/aoc-2023/blob/main/day4/main.py
C has no intersection operation, so I sorted the numbers and counted the matches "manually". Only kept an array for the number of card copies and could do the rest while reading the input. Runs in 3.2 ms on an old 2013 iMac, 3.9 ms on a Raspberry Pi 4 (cpu governor = performance). Short code, only one separate function for sorting: https://github.com/ednl/adventofcode/blob/main/2023/04.c
Readable javascript solution. I will be pushing updating the repo with each days solutions, Love to hear the feedbacks. https://github.com/sanishchirayath1/advent-of-code/blob/master/2023/day4/index.js
p1 https://github.com/SourishS17/aoc2023/blob/main/four-a.py
day 4
Github
[LANGUAGE: Golang] https://github.com/pemoreau/advent-of-code/blob/main/go/2023/04/day04.go
[LANGUAGE: Rust] Pretty simple code
Github for both parts
Part A: Link
recursive (1ms) and non-recursve (36ms) solutions https://github.com/Joxter/advent-of-code/blob/master/2023/js/day04.js
full code: https://github.com/bo-tato/advent-of-code-2023/blob/main/day4/day4.lisp
Code
Source
Solution on GitHub; video on YouTube.
AocKt Y2023D04
[LANGUAGE: Go] https://github.com/silverark/advent-of-code-2023/tree/master/day4
Part 1
[LANGUAGE: Python] https://github.com/CakeDayZ/AdventOfCode2023/blob/main/day4.py
Github
Code
Scratchcards.rs
GitHub Link to Solution
GitLab
Challenging myself to do it in a different language every day, starting out with some more niche languages. Github
Code
cpp file on GitHub
Here's my solution: https://github.com/hugseverycat/aoc2023/blob/master/day04.py
Full program on GitHub and blog post about the problem
[LANGUAGE: C] C standalone
Github
Counter was useful here: github
No heap allocations: https://github.com/tsenart/advent/blob/master/2023/4
[LANGUAGE: Java] - solutions for parts 1 + 2 - github
[LANGUAGE: SystemVerilog] This year, I'm trying to solve AoC using SystemVerilog + CoCoTB/Verilator. 3/4 days, going strong! Link to Github - Day 4
[LANGUAGE: Pike] (see https://pike.lysator.liu.se/)
GitHub
github, 1148 microseconds (both parts together)
Part 1 and Part 2
github
Reasonably proud of my part 2 solution, although would like to try using a recursion scheme rather than unstructured recursion:
Part1 and part2
Github
Slightly better spaced version here
python solution with some type hinting. Part 2 could be sped up with some cache of values instead of calculating sets over and over agin. GitHub
Github
Solution
Part 1: https://github.com/TheBlackOne/Advent-of-Code/blob/master/2023/Day4_1.py
View formatted on GitLab
[Language: Jsonnet] (on GitHub)
[Language: Jsonnet] (on GitHub)
part1
Solution - Github
Python: https://github.com/torbensky/advent-of-code-2023/blob/main/day04/solution.py
Solved using types only: solution
code
Solution(Both Parts)
[Pretty happy with the cleanliness of the code](https://github.com/Will-McBurney/AOC-2023/blob/master/src/main/kotlin/year23/day4/Main.kt), but it feels like the difficulty is all over the place right now.
Github
on Github
[Language: Rust] Source Code
Day04 in C#.
Part 1: set intersection
Here is a link to the source code on GitHub, both the normal one and the minified "punch-card" one.
Solution to Part 1 and 2
github link
[LANGUAGE: TypeScript] Github - Under 40 lines, all parts running under 8ms.
Full code is on Github
github
github
Much better commented version here
Solution in PHP for day 4: https://github.com/mariush-github/adventofcode2023/blob/main/04.php
GitHub (15/16 lines with a focus on readability)
[Language: Go] solution (Both Parts)
I ended up with a similar struct. Here are mine.
[LANGUAGE: Onyx] Day 4 Solution
Part 1: Pretty straightforward. Scan the lines, create 2 arrays. When a match is found, multiply the points by 2 (or add one on the initial draw). Part 2: Used an additional array to store the amount of copies of a card. When a number matches, increase the next card to be increased by the amount of cards of the type that's currently being checked.
source