-
I have a slightly different approach to u/mebeim where I did the if early and made a lambda based on operator.add or operator.mul, but it was enough to avoid eval and save runtime. (ref)
-
Judoscale
Save 47% on cloud hosting with autoscaling that just works. Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.
-
-
The code is here: https://github.com/jes/aoc2022/blob/master/day11/part2.sl (not tidied up, just raw)
-
TypeScript - Single function to solve both P1 and P2 based on parameters, Considering every test by number was prime, i was thinking that P2 must have something to do with Modular arithmetic.
-
Python 3, 100/50. Full code here.
-
Code
-
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Python 3, https://github.com/drrelyea/advent_of_code_2022/blob/master/day11.py
-
AdventOfCode2022
Solutions to all 25 Advent of Code 2022 in Rust 🦀 Less than 100 lines per day, total runtime of less than 1 second. (by AxlLind)
Link to full solution
-
Code
-
-
AoC2022
My solutions for the 2022 Advent of Code event. 50/50 🌟 https://adventofcode.com/2022 (by tomasnyberg)
Github
-
Github
-
Messy. Thankfully got part two pretty quickly recognizing that we can mod the worry level by the product of the test integers. Might refactor / clean this up tomorrow morning
-
Lua
-
python 3.10
-
-
-
-
Day 11 Solutions - I'm a bit tired but will come back to this tomorrow to try to optimize it a little more and to look at other answers to see if I missed anything. I had originally tried with BigInteger (and no modulo lol) and that seemed like it was gonna run for like a week or something for Part 2, so glad I could get it to a couple seconds but wondering if there is more to do
-
Rust - https://github.com/Ununoctium117/aoc2022/blob/main/day11/src/main.rs
-
Simple rust solution that solves both parts with same function. Recordings twitch and youtube.
-
C# (5082/5135)
-
-
Full solution on GitHub
-
Perl
-
Python [Part 1, Part 2] (Yeah, yeah. eval bad, but you aren't running random untrusted inputs, right?)
-
-
**Python**, https://github.com/dsnz/acode_2022
-
Elixir 8683/5438, code including monkey parsing that shows off Elixor's structural matching feature, reflection
-
Rust solution
-
Today's language of choice is Pascal.
-
C++
-
C#
-
Julia using ResumableFunctions for parsing, DataStructures for queue and OrderedCollections for Dict.
-
-
-
Other solutions
-
code
-
-
Python
-
-
-
-
Solution (separate code for each part)
-
For part 2, I immediately had the suspicion that using BigInts wasn't going to cut it, and that was quickly confirmed by the CPU usage. I then wasted time with lcm before noticing that all divisors are primes and thus a simple reduce(1, *) was sufficient.
-
advent-of-code-2022
Attempts at the Advent of Code Challenge for 2022 - see https://adventofcode.com/ (by djm4)
-
Solution Here.
-
I quickly saw that I could do "item = item modulo (product of all div-test numbers)" but the implementation took me a while in C without queues or circular buffers. But that's all part of the fun for me! I didn't look for further clever optimisations because the compiled program runs in 20 ms on a Raspberry Pi 4. That was fast enough for today, I thought. Source code: https://github.com/ednl/aoc2022/blob/main/11.c
-
Link to Monkey.cs, which is the interesting part: github
-
Haskell: https://github.com/bereal/AdventOfCodeHaskell/blob/main/src/Year2022/Day11.hs
-
Kotlin: https://github.com/khouari1/advent-of-code-22/blob/main/src/Day11.kt
-
day11_part2.cpp solved with a common_divisor
-
-
Today's Raku: src
-
-
-
-
Golang solution
-
Rust
-
Part 1
-
Raku
-
-
Rust
-
-
Git repo with live browser based links
-
-
GitHub
-
aoc2022
Trying to solve Advent of Code 2022 in 25 different languages (1 day = 1 language) (by GoldsteinE)
-
-
Easy to read indeed! You could consider implementing the From trait for &str or Vec<&str> instead of rolling your own. Same goes for the 1st include_str! macro for the input. You'll find examples of both in my solution https://github.com/shrugalic/advent_of_code_2022/blob/main/src/day11.rs
-
Part 1. Solved it in PHP.I think, the parsing could have been a bit cleaner. But it works:https://github.com/berbeflo/advent-of-code-2022/blob/master/day11/ex1/solve.php
-
Scala. Pretty happy with how I parsed these into anonymous instances of my Monkey trait. For me part 2 wasn't hard because of the modulo trick, but because I was using mutable queues. So I had to add a reset() method to get things back the way they were before running part 2
-
aoc2022
Discontinued [GET https://api.github.com/repos/krusta4711/aoc2022: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository] (by krusta4711)
Java
-
My Rust solutions. Any ideas on how to make iterating vector elements while mutating other elements of the same vector more elegant?
-
Python https://github.com/PetchyAL/AoC2022/blob/main/solutions/day11/day11.py
-
I did something really similar but kept everything on the stack (using fixed arrays). My runtime is circa 8ms. Code here if you're interested
-
Python: github
-
27293/8665 - Rust
-
Neat, this is now the third year I'm using awk and still learning new tricks. (I'm using awk as the reference, so I don't use gnu extensions.)
-
advent-of-code-2022
Solutions to Advent of Code 2022 puzzles https://adventofcode.com/2022 (by Lysander6)
Rust🦀: github (yes, it's mostly parsing, but there's also some cool pattern matching)
-
advent-of-code-2022
Joel Eisner's completed TypeScript code challenges for "Advent of Code" 2022 (by joeleisner)
-
Github
-
-
-
https://github.com/SourishS17/aoc2022
-
-
I completed today's problem "Monkey in the Middle" - Day 11 - Advent of Code 2022. I implemented the Monkey class and parsing input into this class. Check out my code on #github Github
-
For a beginner, could you explain or point me to an explanation of the m@{..} syntax in your eraseItems, addItem, and processItem functions? It looks like you are destructuring the components of Monkey. I wanted to do something like this for my updateItems function here, but I wasn't sure how to do it.
-
Advent-Of-Code-2022
My solutions for Advent Of Code 2022. Every day is written in another language, chosen randomly. (by Jomy10)
I tried out Haskell, NEVER AGAIN source
-
-
Julia
-
Took me a few hours, but here I am. As I'm self-taught in Python, I wonder what you think.
-
Github
-
Python --> code Sorry not sorry - ugly code, but I can do that much. I least is mine and helped me pass the first trial I didn't understand what to do in the second trial...
-
Cleaner version here: part1.py
-
Code on Github
-
Github
-
Fantom (JVM Based)
-
well...fuck
-
Kotlin
-
Python
-
No particular problem for part 1, it was even fast.
-
-
-
-
Python, 38 lines Once I realized that I have to modulo by the product of all "test"-numbers, Part 2 was easy.
-
Python solution Python
-
Part 1
-
Swift.
-
Advent_of_Code
This project contains my solutions to the programming challenges from Advent of Code. (by MechaDuck)
-
Dlang solution as usual, here's the class that handles monkey business :
-
For what it's worth I've written up my reasoning behind part 2 (solution done in C#, but otherwise irrelevant).
-
Here's a rust solution without Rc and all that stuff. Often if you need to resort to Rc> you're trying to write go/java/c in rust instead of doing it the idiomatic may. HTH!
-
-
Dlang
-
Python
-
-
-
Verbose, but readable object-oriented Python solution.
-
-
advent-of-code-2022
🎄 My Advent of Code solutions in Rust. http://adventofcode.com/2022 (by timvisee)
Part 2 5.72 ms
-
In the end, my solution, especially in the game logic part, is heavily based on the stuff you did.
-
C# solution using .NET Interactive and Jupyter Notebook. Part 1 was pretty straight forward by creating my own Monkey class. For Part 2, had to get some hints here on how to manage the very big numbers.
-
Prolog: https://github.com/dparker2/advent-of-code2022/blob/main/day11.pl
-
Solution in (beginner's) python for part 1. Happy with it. Haven't really taken a crack at part two, hoping there's some reusability
-
Rust solution
-
-
-
Go: Part 1 & 2
-
Typescript Part 1 & 2
-
-
GitHub
-
-
python - https://github.com/Jelly-Pudding/advent-code/blob/main/day11/monke_part2.py
-
-
advent-of-code-go
All 10 years of adventofcode.com solutions in Go/Golang (and a little Python); 2015-2024
-
Advent of Code 2022 - Solution 11 (Python)
-
InfluxDB
InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.