-🎄- 2021 Day 7 Solutions -🎄-

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • adventofcode

    Answers to Advent of Code (by viceroypenguin)

  • advent-of-code-2021

  • Wrong how? I get the correct values for my input, and the correct one for the input/result in OPs repo (tested both 7 and 6): https://github.com/honzatlusty/advent-of-code-2021/blob/master/7/

  • 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.

    WorkOS logo
  • AoC

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

  • rust and python with benchmarks

  • adventofcode2021

    My solutions to adventofcode.com for 2021 (by cptwunderlich)

  • You can find it on github: https://github.com/cptwunderlich/adventofcode2021/tree/main/day7

  • AdventOfCode21

  • Thanks for the code! I referenced it in my example, for Q1. I couldn't get Q2, as is, to work with their puzzle input tho.

  • adventofcode

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

  • TypeScript. For part 2, calculated fuel cost for average ± 1, and took min.

  • advent_of_code

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

  • This is similar to my solutionsolution in Julia (which I'm learning).

  • 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.

    InfluxDB logo
  • Advent-of-Code

    Advent of Code (by michaeljgallagher)

  • Thought I did well, but was still outside the leader board today :(

  • AdventOfCode2021

  • deno_aoc

    🎄 Advent of code solutions written in TypeScript for Deno.

  • advent-of-code

    Node.js advent of code solutions (by sguest)

  • Part 1 | Part 2

  • advent-of-code

  • adventofcode2021

    Solutions to Advent of Code 2021 (by a-mroz)

  • Python. Took me a while to recall the formula...

  • AdventOfCode2021

    Advent of Code Solutions for 21 in rust, shooting for <1ms total runtime by the end (by IndianBoy42)

  • Advent-of-Code-2021

    My solutions for Advent of Code 2021 (by kermitnirmit)

  • Python3 <1000 for both, 500ing so I can't see ranks...

  • advent-of-code-go

    All 8 years of adventofcode.com solutions in Go/Golang; 2015 2016 2017 2018 2019 2020 2021 2022

  • aoc2021

  • Java: https://github.com/abnew123/aoc2021/blob/master/aoc2021/Day7.java

  • adventofcode

    Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in Scala (by sim642)

  • My Scala solution.

  • aoc2021

    Advent of Code 2021 Solutions (by nlowe)

  • Go, ?/? (Leaderboards are temporarily disabled)

  • Advent-of-Code-2021

  • 1st Challenge

  • aoc2021

    My solutions to Advent of Code 2021. (by ritobanrc)

  • Rust, basic bruteforce solution. Played around with trying to find an analytic solution for a couple mins, but ended up just brute forcing it, and surprisingly, its not absurdly slow.

  • AdventCode

  • Advent-of-Code-2021

    Advent of Code Solutions 2021 in Python (by DenverCoder1)

  • advent-of-code

    Solutions to Advent of Code challenges. (by 8483)

  • advent-of-code-2021

  • advent-of-code-2021

    Advent of Code 2021 Submissions (by mariotacke)

  • advent_of_code

  • Day 1

  • AdventOfCode2021.jl

    Advent of Code 2021 in Julia

  • aoc2021

    Discontinued Advent of code 2021 in JS (by TheAngularGuy)

  • advent-of-code

  • AdventOfCodeCSharp

    My AoC Solutions

  • Second Version, remembering Triangle Numbers exist (well, I remembered they existed, I just forgot the formula): https://github.com/Bpendragon/AdventOfCodeCSharp/blob/ea69b3/AdventOfCode/Solutions/Year2021/Day07-Solution.cs

  • AOC2021

    Advent of Code 2021 (by nathanvy)

  • I ended up writing solve functions anyways: https://github.com/nathanvy/AOC2021/blob/main/7.lisp

  • advent-of-code-2021

    Advent of Code 2021 Java 17 (by zebalu)

  • Java 17, could be shorter, but I find this more readable (Gauss has helped a lot.)

  • adventofcode

  • adventofcode

    Advent of Code challenge solutions (by flwyd)

  • Raku, 3004 / 2778. The following (MIT-licensed) code is a code golf version of what I originally wrote.

  • advent

    Git mirror of https://bitbucket.org/sjl/advent (by sjl)

  • advent2021

    Advent of Code 2021 in Rust (by jeremylt)

  • Advent-of-code-2021

    Discontinued [Moved to: https://github.com/Toanuvo/Advent-of-code] (by Toanuvo)

  • aoc-2021

    Advent of Code 2021 with C#/LINQ (by jasonincanada)

  • C# code tries all positions between first and last crab

  • advent-of-code

    Advent of Code puzzles (by KT421)

  • AOC

    Advent of Code solutions (by BreadFish64)

  • I'm not sure if it was strictly necessary to optimize this, but I implemented a binary search for the most efficient fuel value, and just swapped out the fuel calculation function for part two. https://github.com/BreadFish64/AOC/blob/master/AOC/treachery_of_whales.cpp

  • AdventOfCode

    Advent Of Code (by Jo0)

  • AdventOfCode2021

  • Link to github

  • roast

    🦋 Raku test suite

  • Raku solution

  • aoc2021

    Advent of Code - 2021 (by en0)

  • aoc-2021

    Advent of Code (AoC) 2021 solutions (by egel-lang)

  • On github

  • aoc2021

  • Github

  • aoc

    Collection of my Advent Of Code solutions starting from 2021 (by lajp)

  • Part 1

  • advent-of-code

    Advent of code solutions (by tallbikeguy)

  • advent-of-code-2021-kotlin

    Solving all 25 days of the AOC 2021 event here: https://adventofcode.com (by mofeejegi)

  • Kotlin

  • advent-of-code

    https://adventofcode.com/ (by kendallm)

  • advent-of-code-2021

  • My solutions in JS: part one - part two

  • adventofcode.com

    Practising Haskell with AdventOfCode.com puzzles (by sangster)

  • advent-of-code-2021

  • Easy enough -- Python 3 solution

  • aoc

    Advent of Code 2021 in Solidity and JS (by ethsgo)

  • Full solution is at https://github.com/ethsgo/aoc.

  • aoc2021

    Rust implementation of aoc2021 problems (by devzero)

  • Advent-of-Code

    My solutions or attempts at solutions to the Advent of Code event. (by salt-die)

  • Python

  • adventofcode-2021

    Using Dataweave for 2021's Advent of code (by jabez007)

  • Done in Dataweave

  • AoC2021

    Advent of Code 2021 in F# (by kimvais)

  • Your solution is so much cleaner than mine

  • advent_of_code

    Advent of Code solutions (by domm)

  • advent-of-code

  • Kotlin: https://github.com/dragneelfps/advent-of-code/blob/master/src/Day7.kt

  • adventofcode21

    2021 advent of code solutions

  • Ruby

  • aoc2021

    Advent of Code 2021 - my answers

  • Haskell ????/????

  • advent_of_code_2021

    advent of code 2021 attempted with clojure (by jpe90)

  • aoc2021

    Advent of code 2021 solutions, in varied languages (by A-UNDERSCORE-D)

  • As usual, first implementation. Actually started by doing sum(range(1, steps+1)), and after solving remembered that theres a math thing for that (sum(0..n) = n * (n + 1) / 2). Nothing super fancy other than that. Code Finally starting to see speedup from pypy. That JIT is amazing but has its costs.

  • AoC2021

    Advent of Code 2021 (by EragonpeerGynt)

  • elixir Probably not very efficient and quite ugly. But it works... If anyone has any sugestions how to make it better (how to become better @elixir) i would greatly appriciate it

  • advent-of-code

    advent of code (by fridokus)

  • Python https://github.com/fridokus/advent-of-code/blob/master/2021/7.py

  • advent-of-code

    Advent of Code challenges over the years (by jordangarrison)

  • Go day 7. I'm pretty sure there is a faster way to do this, just couldn't think of it. GitHub

  • AdventOfCode2021

    Advent of code 2021 (by marcodelmastro)

  • advent-of-code-2021

  • adventofcode

    adventofcode.com solutions (by linl33)

  • advent-of-code

    Advent Of Code Solutions (by sreedevk)

  • Ruby: https://github.com/sreedevk/advent-of-code/blob/main/ruby/2021/day7/main.rb

  • adventofcode

    https://adventofcode.com/2021/ (by Torakushi)

  • advent-of-code-kotlin

    Advent of code 2021 - Kotlin

  • Kotlin solution for day 7, can be done fairly concisely:

  • advent-of-code-2021

    Discontinued Code I used for solving https://adventofcode.com/2021 (by pavel1269)

  • My Rust solution

  • aoc-21

    Advent of Code 2021

  • My modern C++ solution github ( compiled C++17 )

  • aoc2021

    Advent Of Code 2021 solutions (by constb)

  • Part 1

  • Compact solution in Rust

  • AoC-2021

    Solutions to Advent of Code (https://adventofcode.com/2021) (by InfinityByTen)

  • Solution in Crab Native Tongue: Rust

  • adventofcode

    Advent of code solutions (by mathsaey)

  • aoc2021

    Advent of Code, edition 2021, in Python (by kwentine)

  • My solution in python. Brute force, nothing fancy, using the closed formula for the sum of integers less than n.

  • z3

    The Z3 Theorem Prover

  • The problem space is small enough to explore exhaustively. But I thought I would also give a try to using z3 prover. This is what I came up with for the first part.

  • Advent-of-Code-2021

  • Julia. So...I guess I really overthought this one with a bisection algorithm? Sometimes, with Advent of Code, it helps your part 2 if you generalize early. I thought I was being all clever doing a bisection search that minimizes a generic loss function, but now I see that this optimization wasn't necessary.

  • AoCPractice2018

    My personal solutions to the Advent of Code challenges for 2018 and 2019, all in Python.

  • Github

  • AdventOfCode

    Advent of Code Solutions over the years (by dmiller2606)

  • Python 3 O(n) runtime for both solutions, using median and mean to calculate the best possible meeting place. Part B uses the Gaussian Sum to calculate the cost. Solution A & B

  • aoc2021

    Advent of Code 2021 (by Legolaszstudio)

  • AdventOfCode

    My solutions to the Advent of Code puzzles. (by kemmel-dev)

  • .Python brute force: https://github.com/kemmel-dev/AdventOfCode2021/blob/master/day7/d7p2.py

  • advent-of-code

  • AdventOfCode2021

  • Todays problem looked perfect for Octave (again). Also did my daily python solution (https://github.com/sotsoguk/AdventOfCode2021/blob/a6102d061994ce5dc1f5dddfa881b65cac40b209/python/day07/day07.py) [Day07.py]

  • aoc-excel-2021

    Advent of Code 2021 entirely in Excel without VBA

  • all solutions so far

  • adventofcode2021

    our team's solutions for advent of code 2021 (by northflank)

  • adventofcode

    Advent of code solutions (by julian-west)

  • Python solution (GitHub) using Gauss formula for part 2

  • AdventOfCode

  • Solution in GameMaker Language.

  • aocc

    Advent of Code solutions in C

  • all solutions

  • aoc2021

  • advent

    Advent of Code (by aevitas)

  • adventofcode-2021

    Advent of Code 2021 solutions (by pille1842)

  • Source code. Took me quite a while to realize that 1 + 2 + 3 + ... + n is not a factorial :( Other than that, pretty simple today.

  • AdventOfCode

  • [GitLab link] https://gitlab.com/bastiendussapapb/adventofcode-2021/-/blob/main/Notebook/day7.ipynb

  • Haskell, using gradient descent. The code's actually short enough to post here! Writeup on my blog and code on Gitlab.

  • aoc2021

    Solutions for Advent of Code 2021 (by arturhoo)

  • advent-of-code-kotlin-2021

    My solution attempts to Advent of Code 2021

  • My overengineered Kotlin solution: https://github.com/ThomasBollmeier/advent-of-code-kotlin-2021/blob/main/src/de/tbollmeier/aoc2021/day07/Day07.kt

  • Advent-of-Code

    solutions for Advent of Code Problems (by brownboycodes)

  • 💡 source code to Day 7 : The Treachery of Whales

  • adventofcode

    This repo contains (almost) all of my solutions for adventofcode problems. (by kiriDevs)

  • The first one I'll actually share, it's already on GitHub

  • aoc2021

    Advent of Code 2021, this time in Go (by danvk)

  • aoc2021

    Advent of Code 2021 on my homemade 16-bit CPU SCAMP (by jes)

  • AdventOfCode

  • You can try my input if you want. https://github.com/l0zzyy/AdventOfCode/tree/main/2021/7

  • adventofcode

    Advent of code solution programs. (by bertptrs)

  • Part 1 and 2 in Rust. Felt really silly not realizing that part 1 is just the median by definition, and instead going with a complicated DP solution.

  • advent-of-code

    Solutions for adventofcode.com (by alexandru-dinu)

  • solve.py

  • adventofcode2021

    advent of code 2021 (by jhernandez89)

  • adventofcode

    Advent of Code Repo for Zach Attakk (by ZachAttakk)

  • Full code for Part 1 and Part 2, as well as my ramblings.

  • advent-of-code

    Advent of code solutions (by rbusquet)

  • AoC

    Advents of Code in NASM x86_64 assembly (by JustinHuPrime)

  • Part 1

  • AOC2021-postgresql

    Advent of Code 2021 done with vanilla postgresql.

  • AdventOfCode

    Advent of Code (by thedavecarroll)

  • PowerShell

  • aoc2021

    Advent of Code 2021 (by gustafe)

  • advent2021

    advent woop woop (by gende0808)

  • PHP Part 1 6 lines PHP Part 2 7 lines

  • aoc2021

    Advent of Code 2021 (by jslepicka)

  • AdventOfCode2021

  • aoc-2021-in-kotlin

  • aoc-typescript

  • advent-of-code

    Solutions for Advent of Code 2017 in javascript (ES6) (by Akallabet)

  • My solution in Javascript, kinda brute force, but still under 300 ms

  • advent-of-code-2021

    My solutions to advent of code 2021 in deno/TS (by J-Swift)

  • AOC2021

    Advent of Code 2021 (by Rakicy)

  • aoc

    My solutions to the https://adventofcode.com/ (by vollcheck)

  • My solution in Clojure, however should optimize part two as it takes 7s and is pretty naive approach.

  • AdventOfCode

    https://adventofcode.com/ answers (by GastonBC)

  • Part 1

  • advent-of-code

    Advent of code solutions (by Fubuchi)

  • advent-of-code

    Watch me give up half way through >_> (by gabts)

  • aoc

  • aoc-2021

    Advent of Code 2021 in PHP (by soodssr)

  • PHP

  • aoc

    Advent of Code Solutions (by joeyemerson)

  • aoc2021

    Advent of Code 2021 (by krmaxwell)

  • In the spirit of "premature optimization is the root of all evil, I just brute forced it. The test suite ran in 70ms on my system so that was good enough for me not to worry about further optimization.

  • advent-2021

    Discontinued [Moved to: https://github.com/Crazytieguy/advent-of-code] (by Crazytieguy)

  • advent

    Advent Of Code (by pkrawc)

  • AoC2021

  • Python

  • adventofcode21

    https://adventofcode.com/2021/ (by dunefox)

  • Julia: https://github.com/dunefox/adventofcode21/blob/main/7/main.jl

  • aoc-2021-in-kotlin

  • aoc2021

    Advent of Code, 2021 (by gkwaerp)

  • Full repo here.

  • AdventOfCode

    Playing around with http://adventofcode.com/ (by stormsweeper)

  • advent-of-code-2021

    Advent of code 22021 (by RansomTime)

  • AdventofCode

  • AdventOfCode2021

  • Part1 and Part 2

  • advent-of-code-2021

    All solutions for the 2021 Advent of Code event. (by Bruception)

  • AdventOfCode2021

    Advent of code solutiosn (by McSick)

  • Rust: https://github.com/McSick/AdventOfCode2021/blob/main/07/crab-attack/src/main.rs

  • AdventOfCode

    Advent of Code Solutions (by auxym)

  • AdventOfCode2021

  • I don’t like it, but I don’t dislike it enough to change it.

  • aoc2021

    Advent of Code 2021 (by xphade)

  • AdventofCode2021

  • aoc2021

    Advent of code 2021 in Kotlin! (by crnkofe)

  • Advent_of_Code

    My Advent of Code solutions. (by Farbfetzen)

  • My solution in Python. I realised that I could use the median for part 1 and mean for part 2 like some others here.

  • advent-of-code

    My solutions to http://adventofcode.com/ :) (by csb324)

  • Ruby solution (github)

  • advent-of-code

    coding challenges done as part of https://adventofcode.com/ (by Marijus)

  • AoC2021

    Advent of Code 2021 (Python) (by carsongmiller)

  • Python Repo (With days 1-7)

  • aoc

    Advent of Code (by c-kk)

  • AdventOfCode2021

  • PHP, bruteforce. Part 2 below, it uses a formula to calculate the sum of a range. I'll now go check the optimal solutions.

  • advent-of-rust-2021

    Solutions to Advent of Code 2021 in Rust

  • Solution

  • advent-of-code

  • advent_of_code_2021

    advent of code 2021 (by benkonz)

  • D

  • Advent-of-Code

  • nanim

    Nanim is an easy-to-use framework to create smooth GPU-accelerated animations that can be previewed live inside a glfw window and, when ready, rendered to videos at an arbitrary resolution and framerate.

  • Crab Dance 🦀🕺 solution + animation using nanim https://pietroppeter.github.io/adventofnim/2021/day07.html

  • AdventOfCode2021Kt

  • advent-of-code

    Collection of JS solutions for puzzles from adventofcode.com 🎁🎄 (by romellem)

  • code

  • aoc2021

    Advent of Code 2021 (by ntsoftware)

  • part1 part2

  • advent-of-code-day-7

  • Advent-of-Code-2021

  • [Github]

  • aoc2021

  • Python monte carlo-like solution. Github

  • adventofcode

  • Python 3.8 solution

  • aoc-2021-clj

  • Finally caught up! Here's the Clojure source and tests for today.

  • AdventOfCode2021

  • advent-of-code

  • advent-of-code-2021

    Discontinued My solutions to https://adventofcode.com/2021 (by plan-x64)

  • aoc

  • Shortest readable Python (no external libraries) and C++

  • adventofcode

    Repo for advent of code exercises 2021 (by wbratz)

  • You can also checkout the solution on my github repo https://github.com/wbratz/adventofcode/tree/master/day7

  • AoC2021

    Advent of Code puzzles (by mpschuetze)

  • Puzzle 2 BlockDiagram

  • advent-of-code

  • advent-of-go

    advent of code 2021. solving what I can in Go otherwise solving in javascript

  • AdventofCode

  • adventofcode-2021-solutions

    Solutions for Advent of Code 2021 edition

  • adventofcode.sh

    Advent of Code 2020 and 2015, done in bash. Because why not?

  • My final script is in my repo, but an earlier commit has this brute force version. https://github.com/einarjon/adventofcode.sh in the 2021 folder.

  • I wrote myself a little AoC framework, which supports testing and performance evaluation. I use Unit tests to run my code against the examples (see here).

  • advent-of-code

    solutions for Advent of Code (by micod-liron)

  • advent-of-code-2021

    Advent of Code 2021 code challenge solutions. Kotlin this year! (by aormsby)

  • Kotlin median and mean. I'm sure there's some simplification that could be done, but I ain't doin' it. Day 8 awaits.

  • AdventOfCode2021

    My solutions to https://adventofcode.com/2021 (by willkill07)

  • Advent-of-Code-2021

  • GitHub/CrabSubmarines.java

  • AdventOfCode2021

    AdventOfCode 2021 solutions (by Meldanor)

  • aoc-2021

    Advent of Code 2021 (by dwalker109)

  • While benchmarks are the only proper way to get runtimes, a crate like Logging Timer will allow you to accurately spit out times just by annotating a function. See https://github.com/dwalker109/aoc-2021/blob/main/day07/src/main.rs for an example.

  • advent-of-code

    My solutions in F# and Python to Advent of Code (by vittoboa)

  • F#

  • adventofcode2021-day7

    Advent of Code day 7 solution in Kotlin

  • Straightforward Kotlin solution

  • Advent-of-Code-2021

    Advent of Code 2021 (by HDv2b)

  • I messed up. First I tried getting the mean average position to move all the crabs to, but that number was way off. So then I tried bisecting my way to an answer: https://github.com/ElGoorf/aoc2021/blob/main/07/01.js

  • advent-of-code-2021

    Advent of Code in Golang! (by gwpmad)

  • Golang solution (I am learning the language via Advent of Code): https://github.com/gwpmad/advent-of-code-2021/blob/main/7/main.go

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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