Our great sponsors
-
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.
-
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.
-
AdventofCode2020
My codes for each day of the AoC 2020, not all are great by lack of time and skills in C++ (by Shadowwws)
-
adventofcode2020
Solutions for the 2020 Advent of Code advent calendar of daily programming puzzles (by erjicles)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Haskell
Code, optimized a bit ("the cool kid optimization"), to find only the smallest loop size: https://github.com/jwise/aoc/blob/master/2020/25-coolkid.lua
github
Merry Christmas everyone!
Thanks for an amazing year! Definitely a lot easier this year than last one, which was a bit sad. No hard graph problems, requiring path finding algorithms, no insane math problems like day 22 last year. It's hard finding the right balance. I think 2019 was maybe a bit too hard and this year maybe too easy.
Dyalog APL 395/315
My Answer\ There isn't much to say about today's puzzle. A rather straightforward MATLAB implementation. Merry Christmas everyone!
Github
Github Link
C++ (code). Took a few minutes to hack up a modular exponent function (repeated squaring).
JavaScript
rust
Clojure
Python 26/23
C# Solution
code
Java Today was very easy, but it took me considerable effort to wrap my mind around the problem. I was almost about to do a multithreaded solution when I facepalmed and implemented what I actually had to implement.
JavaScript 2721/2260
Python solution Took time to understand the question
Common Lisp. It's been fun, everyone. Until next year!
TypeScript
F#
More golfs for other days in my repo.
My solution in Rust: https://github.com/LinAGKar/advent-of-code-2020-rust/blob/main/day25a/src/main.rs
Haskell hand-rolled discreteLog (BSGS) and expMod
Code
Part 1
Simple Haskell solution. I didn't know about powMod until just now so I wrote a basic iterable step function:
https://github.com/erjicles/adventofcode2020/tree/main/src/AdventOfCode2020/AdventOfCode2020/Challenges/Day25
My Haskell solution.
Using the Baby Step Giant Step algorithm for computing discrete logarithms: https://github.com/seanhandley/adventofcode2020/blob/master/ruby/day_25/advent25.1.rb
Rust. Just implemented everything as specified. 3.7 ms