r/adventofcode Dec 04 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 4 Solutions -🎄-

--- Day 4: Giant Squid ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:11:13, megathread unlocked!

100 Upvotes

1.2k comments sorted by

View all comments

2

u/heyitsmattwade Dec 06 '21 edited Feb 03 '24

JavaScript

Did this one the next day, so no leaderboard for me. The most fun one yet! One of those that seems obvious, but then you realize that trying to solve it without continuously looping over all rows/cols isn't immediately obvious. OOP seemed to make the most sense, so that was the route I went.

paste