-๐ŸŽ„- 2020 Day 22 Solutions -๐ŸŽ„-

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/adventofcode

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • OPS - Build and Run Open Source Unikernels
  • GitHub repo aoc-2020

    My solutions for https://adventofcode.com (by ScottBailey)

    In part1, though, vector was repeatably faster than circular_buffer. About 40us for vector and 70us or so for circular buffer. I expected circular buffer would out perform vector for this task.

  • GitHub repo advent-of-code

    My solutions for Advent of Code (by AlexAegis)

    TypeScript

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and ๏ปฟexternal services monitoring, Scout is a developer's best friend when it comes to application development.

  • GitHub repo aoc2020

    Advent of Code 2020 - my answers

    Haskell

  • GitHub repo adventofcode

    I added an AtomicInteger counter to each of our caching branches here in yours, and here in mine.

  • GitHub repo aoc2020

    As I'm trying to optimize my solution (~3s) so I tried to check what makes your solution so fast, but it doesn't seem to work with my input. Example and part 1 works as expected, but part 2 with my input returns 8104 instead of 32665

  • GitHub repo aoc-2020

    Advent of Code 2020 (by aldanor)

    Borrowed both ideas in my version :) On my input your version runs at 3ms, mine in 1.5ms, so it might be faster on some inputs (link). I initially started with something similar to yours but then figured why not use 512-bit ints, so that the notion of 'head' and 'tail' disappears as your head then stays at position 0 (so, e.g., to remove a card, you just right-shift the whole bigint). Also used a tiny bit of simd along the way.

  • GitHub repo Advent_of_Code_in_Pascal

    My solutions to the Advent of Code, in Free Pascal

    Only to find that I had wasted about 2 hours.. and had to re-implement everything, so the second time I did it quick and dirty instead. I kept the cards as strings with the deck being a single string... way, way simpler, even with the recursion, etc.

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • GitHub repo AoC

    my personal repo for the advent of code yearly challenge (by Fadi88)

    github

  • GitHub repo AoC2020

    Programs for Advent of Code 2020 (by Perska)

    CrabSharp (aka C#) Solution

  • GitHub repo advent-of-code-2020

    Done in boring old python (by peter-tanner)

    part 1

  • GitHub repo Advent2020

    Python 3, 905 on the part 2 leaderboard, which is a good position for me.

  • GitHub repo AoC2020

    Advent Of Code 2020 (by ShaoshiZ)

    Part 1\ Part 2\ Since the script for part 2 is written in a recursive way, there is an extra step to get the final answer. The final answer can be easily obtained based on the non-empty deck.\ \ I was confused by the infinite loop prevention rule, but other than that, pretty simple puzzle.

  • GitHub repo advent_of_code_2020

    My Advent of Code 2020 repository (by zv0n)

    code

  • GitHub repo advent-of-code

    My solutions for Advent of Code (by besasam)

    Python. Part 2 threw me for a loop (similar to many others here, it seems) but it's nice to be reminded to read the instructions carefully and not just rely on results from the sample inputs. Not terribly performant, but it runs quickly enough and the code is hopefully not too hard to read, so I'm quite happy with it.

  • GitHub repo advent_2020

    Advent of code 2020 [Moved to: https://github.com/mattteochen/AoC]

    part 1 part 2

  • GitHub repo advent-of-code-2020

    Solutions to Advent of Code 2020. (by joe-reed)

    Go/Golang

  • GitHub repo advent-of-code

    Advent of Code in python3 (by lehippie)

    Python3 solution

  • GitHub repo adventofcode

    RUST

  • GitHub repo advent-of-code

    My solutions to the Advent of Code puzzles (by meckenbach)

    Here are all my Python solutions so far in a Jupyter notebook, including today's one.

  • GitHub repo AdventOfCode

    My Advent of Code solutions. I also upload videos of my solves: https://www.youtube.com/channel/UCuWLIm0l4sDpEe28t41WITA (by jonathanpaulson)

    Python, placed 454/29. Code: https://github.com/jonathanpaulson/AdventOfCode/blob/master/2020/22.py. Video of me solving: https://youtu.be/iD4R7wSNrdw

  • GitHub repo advent-of-code-2020

    Python, 138/16. code (permalink) & screen recording

  • GitHub repo advent-of-code-2020

    Answers and solutions for Advent of Code 2020. (by Bruception)

    Python3 simple solution.

  • GitHub repo adventofcode

    AoC 2020 Day 22 - Kotlin. 2094/2452

  • GitHub repo Advent-of-Code

    Advent of Code (by michaeljgallagher)

    Finished part 1 in 8 minutes, then proceeded to take over an hour to finish part two. Re-wrote the while loop maybe 5 times and got 5 different answers from my input, yet it would always pass the test cases

  • Golang

  • GitHub repo aoc-2020

    My solutions to Advent of Code 2020. (by Fryer)

    JavaScript 2291/1888

  • GitHub repo aoc2020

    Advent of Code for 2020 (by UnicycleBloke)

    Python (1906/2343): https://github.com/UnicycleBloke/aoc2020/blob/main/day22/day22.py

  • https://gitlab.com/t-rkr/advent-of-code-2020/blob/master/day22/day22.pl

  • GitHub repo AdventOfCode2020

    Solutions for the Advent of Code 2020 challenges in Java. (by SizableShrimp)

    Java, 417/312. https://github.com/SizableShrimp/AdventOfCode2020/blob/master/src/main/java/me/sizableshrimp/adventofcode2020/days/Day22.java

  • GitHub repo AdventOfCode2020

    JavaScript Solution day 22

  • GitHub repo aoc2020

    Solutions for Advent of Code 2020 (by frerich)

    Python 3 Solution

  • GitHub repo aoc

    advent of code (by apparentorder)

  • GitHub repo advent-of-code-2020

    ๐ŸŽ…๐ŸŒŸโ„๏ธโ˜ƒ๏ธ๐ŸŽ„๐ŸŽ (by mstksg)

    [Haskell] (Taken from my daily haskell reflections)

  • GitHub repo aoc-clojure

    Advent of code 2020 solutions in Clojure

    Clojure: https://github.com/mgrzeszczak/aoc-2020-clojure/blob/master/src/aoc_2020_clojure/day22.clj

  • GitHub repo aoc2020_solutions

    Python 3 part1, part2

  • GitHub repo advent-of-code-2020

    Part 1 & 2

  • GitHub repo advent-of-code

    All Advent of Code solutions in Python (by taddeus)

    python3: https://github.com/taddeus/advent-of-code/blob/master/2020/22_spacecards.py

  • GitHub repo AoC-2020

    Solutions for Advent of Code 2020 (by Rtchaik)

    Python solution with deque

  • GitHub repo aoc-2020

    Advent of code 2020 in Python and Rust (by TamTran72111)

    These are my solutions in Python and Rust, which run in 2.5s and 0.6s respectively. I am looking for some ways to improve the performance

  • GitHub repo aoc2020

    Advent of Code 2020, while learning Scala (by grey-area)

    Part 2 in Scala

  • GitHub repo advent-of-code-2020

    Solutions for Advent of code (by abhijithasokan)

    Code (see function - game_l2)

  • GitHub repo Advent-of-Code-2020

    Advent of Code 2020 written in C++ using VS code with WSL integration. (by daniel-meilak)

    GitHub solution to Part 2

  • GitHub repo adventofcode2020

    2020 Advent of Code (by rocksoftcode)

    Groovy

  • GitHub repo aoc_2020

    Advent of Code 2020 (by natemcintosh)

    Julia

  • GitHub repo comp_prog

    My solutions to competitive programming problems

    Python3 solution on GitHub. Just simulated it. I missed the part that says that when you start a sub-game, that you should only use the first p1card and p2card amount of cards from each deck in that sub-game. Without that, it would take a very long time for the game to end (as I found out after several hours of hoping lol).

  • GitHub repo advent_of_code_2020

    Some Ada solutions to Advent of Code 2020. (by YoannDupont)

    Ada

  • GitHub repo Advent-of-Code-2020

    Made it through all 25 days of Advent of Code fo the first time! (by Leftfish)

    Here's my Python solution: https://github.com/Leftfish/Advent-of-Code-2020/blob/main/22/d22.py

  • GitHub repo advent-of-code-2020-jq

    Solving Advent of Code with jq [Moved to: https://github.com/odnoletkov/advent-of-code-jq]

    Part 2

  • GitHub repo adventOfCode-2020

    Code Challenges and Practice (by valiant-code)

    Java - main & Part 2 game logic

  • GitHub repo aoc2020

    Advent of Code 2020 (by jacksonriley)

    Nothing clever about it :) I just tried to use this method of hashing (since it was about 3 times faster than what I was already doing), and noticed that it resulted in the wrong answer for part 2 for my input - so it definitely does matter for some cases!

  • GitHub repo advent-of-code-2020

    ๐Ÿฆ€ Rust solutions to AoC 2020 (by wfxr)

    Rust solution:

  • GitHub repo ruby

    The Ruby Programming Language [mirror]

    Yeah, in most languages set is just a wrapper around hash. Pretty sure that's the case with Ruby - https://github.com/ruby/ruby/blob/master/lib/set.rb

  • GitHub repo AdventOfCode-rs

    The https://adventofcode.com in idiomatic declarative Rust

    A Rust solution which would be really easy to adopt to multiple players. It takes 70 ms for both parts.

  • GitHub repo Advent_of_Code

    These are my solutions to the Advent of Code puzzles. These are some of my first Python scripts, so please manage your expectations. :^) (by Nomen-Heroum)

    Mine went down from 20062 to 16881 recursive calls, here's my code (also Python 3). Just add a global CALLS before line 7 and global CALLS; CALLS += 1 before line 17 in the if block to count the function calls.

  • GitHub repo aoc2020

    Advent of Code 2020 (by sporksmith)

    Rust, with a pretty straightforward approach.

  • GitHub repo advent-of-code

    Solutions for Advent of Code (by smrq)

    Part 1 Part 2

  • GitHub repo advent-of-code-2020

    My solutions for Advent of Code 2020 tasks (by Jozkings)

    Python 3 (1345/540)

  • GitHub repo advent_of_code

    part1

  • GitHub repo adventofcode-solutions

    ๐ŸŽ„ Solutions to https://adventofcode.com/ in javascript

    My input: https://github.com/xPaw/adventofcode-solutions/blob/d5b979f4a4fe45b5c14c290c69cb7c7d323310ec/2020/data/day22.txt

  • GitHub repo AoC2020

    Swift

  • GitHub repo adventofcode

    Solutions for Advent of Code over the years (by sburuiana)

    C++ 324/394

  • GitHub repo advent-of-code-go

    (All 7 years of) adventofcode.com solutions in Go

    Go Solution 537/997

  • GitHub repo AdventOfCode2020

    Advent of code 2020 repository. (by Tomas-Juri)

    C#

  • GitHub repo Advent-of-Code-2020

    My solutions for Advent of Code 2020 (by kermitnirmit)

    Python3 my solution. Takes a few seconds for part2.

  • GitHub repo adventOfCode

    Solutions to the 'Advent of Code' (http://adventofcode.com) programming challenges in Elm (by jwoLondon)

    Literate Elm

  • GitHub repo advent-of-code

    Haskell by a non-Haskell programmer ;)

  • GitHub repo aoc

    ๐ŸŽ„ My solutions and walkthroughs for Advent of Code (https://adventofcode.com) and more related stuff.

    Python 3 solution - Walkthrough

  • GitHub repo AdventOfCode-Java

    adventOfCode(Language.JAVA);

    Java Fun day, I like space cards. I had minor Vietnam flashbacks to the spacecards of last year, but luckily it was nothing like that. Some takeaways:

  • GitHub repo aoc-2020

    Nodejs solution

  • GitHub repo advent-of-code

    advent of code (by fridokus)

    Python 3

  • GitHub repo AdventOfCode2020

    Solving Advent of Code 2020, each day in a different language (by bereal)

    Elixir

  • GitHub repo hashbrown

    Rust port of Google's SwissTable hash map

    Doesn't really matter. My original solution was just like yours, but because other people have decided to use *both* deques I've changed mine... and ... it did not work. It turned out to be a bug in hashbrown lol: https://github.com/rust-lang/hashbrown/issues/218

  • GitHub repo adventofcode.com

    Scala

  • GitHub repo aoc-2020

    Advent of Code 2020 (by tpaschalis)

    Any comments are more than welcome! https://github.com/tpaschalis/aoc-2020/blob/main/day22/day22.exs

  • GitHub repo adventofcode

    Solutions for problems from AdventOfCode.com (by bhosale-ajay)

    JavaScript/TypeScript Repo

  • GitHub repo Advent-of-Code

    C# solutions for Advent of Code puzzles (by DjolenceTipic)

    Long day at work, the long time needed to solve all.

  • GitHub repo Advent-of-Code-2020

    Solutions for the 2020 Advent of Code puzzles (using javascript and NodeJS) (by chaeron)

    All of my 2020 puzzle solutions, including giving crabs a beating are here: https://github.com/chaeron/Advent-of-Code-2020

  • GitHub repo advent-of-code

    ๐ŸŽ„ This is my set of awesome solutions for the Advent of Code puzzles (by garciparedes)

    Part 1: https://github.com/garciparedes/advent-of-code/blob/master/2020/22_crab_combat_part_1.rs

  • GitHub repo advent_of_code

    Solutions to programming puzzles on Advent of Code (by Praful)

    Full source code here.

  • GitHub repo advent-of-code

    My solutions for the Advent of Code (by JesperDramsch)

    Kept it fairly simple in Python. Runs in half a second for both parts together.

  • GitHub repo aoc2020

    Haskell Solutions to Advent of Code 2020 (by haskelling)

    Code Repository: https://github.com/haskelling/aoc2020

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts