Member-only story

Advent Of Code 2021 — Giant Squid — Puzzle 4

Xavier Jouvenot
5 min readJan 25, 2022

--

AdventOfCode, C++, Programming

Hello ! I’m Xavier Jouvenot and here is the 4th part of a long series on Advent Of Code 2021.

For this new post, we are going to solve the problem from the 4th December 2021, named “Giant Squid”. The solution I will propose in C++, but the reasoning can be applied to other languages.

Self promotion: You can find other articles on computer science and programming on my website 😉

Part 1

The Problem

The full version of this problem can be found directly on the Advent of Code website, I will only describe the essence of the problem here:

After diving into the decoding the report of the submarine, during the Day 3, we are now deep into the ocean. So deep, that a giant squid attach itself to the submarine and that we are going to play bingo with it ! The rule are simple, there are some bingo cards available and we know which numbers are going to be chosen, and the first card to have either a row or a column of number marked (meaning the numbers have been selected during the previous round) win.

In order to make sure that we have the right card, the website ask us to give it a specific number obtained by multiplying the last number used during the last round to the sum of the unmarked number of the winning board.

You can look at the example given on Advent of Code website, if you want to look at…

--

--

No responses yet