Our great sponsors
-
-
32/14 Rust, just bruteforced the heck out of it, took 6-7 minutes but was worth the wait. Later I will clean it up. https://github.com/SkiFire13/adventofcode-2022-rs/blob/master/src/day19.rs
-
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.
-
AdventOfCode
My Advent of Code solutions. I also upload videos of my solves: https://www.youtube.com/channel/UCuWLIm0l4sDpEe28t41WITA
Python3, 5/5. Video. Code. I'm now in second place overall!
-
Advent-of-Code
A repository holding all of my solutions to Advent of Code problems (by Noble-Mushtak)
Python 3, 6/13, code here
-
My solution is just a bruteforce BFS, with some parallelism thrown in. The key idea for me was to realize you can skip building robots if you earn more than the cost of that material per round.
-
Part 2 assumes you did part 1 properly. I did not! I'm pretty sure that the intended solution is to do a sort of reverse search (have a target number of geodes and work backwards to see if that's possible to achieve) but I was just not having success coming up with a way to do that. It's probably going to be blindingly obvious once I figure it out, but that might be an exercise for tomorrow.
-
Part 1 I prune based on resources gathered by type complexity. So a branch's score is ore * 1 + clay * 2 + obs * 3 + geo * 4. I tried squaring the complexity instead, because that seemed right, but I thought it was giving a bad result for some reason and went back.
-
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.
-
advent-of-code
My Advent of Code submissions. For 2021 and before, these are the original code I used, without any modifications after-the-fact. As such, they are probably not as efficient or short as they should be, because I want a working solution faster, not a better solution. For 2022 and after, these are the solutions uploaded to my YouTube channel.
Python 3 - P1 - P2 - Video
-
-
Julia
-
-
-
Clojure
-
Rust.
-
Elixir 2031/2641 after 3.25/6.5 hours! Code on GitHub
-
I did something very similiar, both today and on day 16
-
Solution was greatly prettified.
-
Solution uses the same algorithm for both parts. I brute forced all possible combinations and added constraints until I got a result in a reasonable time:
-
Julia
-
F#
-
-
JavaScript
-
have done it for 9h 30 mins but still no solution. Really messes me off What is best pattern for example code 2. So far this is best for me:
-
[Part 1](https://github.com/mfornet/advent-of-code-2022/blob/main/day19a/src/main.rs)
-
C++ (66 sloc)
-
AdventOfCode2022
As much of 2022's advent of code as I can be bothered / have a big enough brain to do. (by TomHemery)
C#
-
Ruby
-
Solution here, uses dynamic programming solutions that "fast-forward" based on next possible robot build, as in other solutions.
-
------------------------------------ 386 solutions and counting in Java over on Github. Feel free to check it out, utilize it, and reach out with questions or bugs!
-
Here's my solution. It's a bit of a janky script.
-
github link
-
Rust
-
[source]
-
My Rust solution, runs in ~20ms with rayon and it's pretty well commented. The only optimizations are:
-
-
Java
-
Scala
-
Python + ortools + spreadsheets
-
Kotlin - not very fast (15 sec. for both on an older MBPro) - link
-
-
After trying BFS, DFS and backtracking exploring 1 minute at a time, I found your solution and copied got inspired by it: https://github.com/ciscou/aoc/blob/master/2022/19.rb
-
-
Here's the code -- it's as close to identical to yours as I could get, and I couldn't find any pesky typos or anything.
-
Rust 83 ms for both parts on the input on my box.
-
-
Rust, I used Linear Programming too, after I did not found reasonable pruning methods on the search tree. My code is there. I never did LP before, only heard of it, so yesterday was a long day!
-
good_lp
Linear Programming for Rust, with an user-friendly API. This crate allows modeling LP problems, and let's you solve them with various solvers.
I would like to see your code to see how you did it. I used the crate good_lp but it required an external command line "cbc" for me (on Windows) and failed to use GLPK later.
-
-
Noulith 193/351
-
-
-
Python: https://github.com/years/2022/19/2022_day_19.py
-
advent-of-code-2022
Advent of Code 2022 – Object-Oriented Solutions in Java: https://www.happycoders.eu/algorithms/advent-of-code-2022/ (by SvenWoltmann)
-
advent-of-code-go
All 8 years of adventofcode.com solutions in Go/Golang; 2015 2016 2017 2018 2019 2020 2021 2022
-
Pure native Python
-
Python
-
Advent_of_Code
A repo revolving around attempting to solve the Advent of Code puzzles with single-statement t-sql (by adimcohen)
-
JavaScript/TypeScript - Finally made both parts run under a second. This took way to long, copied many ideas from this thread.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives