summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMia Herkt <mia@0x0.st>2021-12-20 15:33:09 +0100
committerMia Herkt <mia@0x0.st>2021-12-20 15:33:09 +0100
commit43356e90d8b503d21305c892dfba8f6f704473a9 (patch)
treefd78a639387b4e844902824d95a9d8f31f972bad
parente1e50de4e3703575042f352e586ed292d68df2bb (diff)
downloadaoc2021-43356e90d8b503d21305c892dfba8f6f704473a9.tar.bz2
aoc2021-43356e90d8b503d21305c892dfba8f6f704473a9.tar.xz
Add problem texts
-rw-r--r--01/problem.html87
-rw-r--r--01/problem.txt76
-rw-r--r--02/problem.html76
-rw-r--r--03/problem.html72
-rw-r--r--04/problem.html71
-rw-r--r--05/problem.html73
-rw-r--r--06/problem.html62
-rw-r--r--07/problem.html67
-rw-r--r--08/problem.html122
-rw-r--r--09/problem.html74
-rw-r--r--10/problem.html99
-rw-r--r--11/problem.html348
-rw-r--r--12/problem.html147
-rw-r--r--13/problem.html116
-rw-r--r--14/problem.html65
-rw-r--r--15/problem.html170
-rw-r--r--16/problem.html122
-rw-r--r--17/problem.html128
-rw-r--r--18/problem.html173
-rw-r--r--19/problem.html364
-rw-r--r--20/problem.html110
21 files changed, 2546 insertions, 76 deletions
diff --git a/01/problem.html b/01/problem.html
new file mode 100644
index 0000000..6b73ba8
--- /dev/null
+++ b/01/problem.html
@@ -0,0 +1,87 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, text/html, charset=UTF-8" http-equiv="Content-Type">
+ </meta>
+ <title>Day 1 - Advent of Code 2021</title>
+ <style type="text/css">
+ body {
+ margin: 30px auto;
+ max-width: 650px;
+ line-height: 1.4;
+ padding: 0 10px;
+ }
+ h1, h2, h3 {
+ line-height: 1.2;
+ }
+ </style>
+</head><div id="readability-page-1" class="page"><div>
+
+<article><h2>--- Day 1: Sonar Sweep ---</h2><p>You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean!</p>
+<p>Before you know it, you're inside a submarine the Elves keep ready for situations like this. It's covered in Christmas lights (because of course it is), and it even has an experimental antenna that should be able to track the keys if you can boost its signal strength high enough; there's a little meter that indicates the antenna's signal strength by displaying 0-50 <em>stars</em>.</p>
+<p>Your instincts tell you that in order to save Christmas, you'll need to get all <em>fifty stars</em> by December 25th.</p>
+<p>Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants <em>one star</em>. Good luck!</p>
+<p>As the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar sweep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine.</p>
+<p>For example, suppose you had the following report:</p>
+<pre><code>199
+200
+208
+210
+200
+207
+240
+269
+260
+263
+</code></pre>
+<p>This report indicates that, scanning outward from the submarine, the sonar sweep found depths of <code>199</code>, <code>200</code>, <code>208</code>, <code>210</code>, and so on.</p>
+<p>The first order of business is to figure out how quickly the depth increases, just so you know what you're dealing with - you never know if the keys will get <span title="Does this premise seem fishy to you?">carried into deeper water</span> by an ocean current or a fish or something.</p>
+<p>To do this, count <em>the number of times a depth measurement increases</em> from the previous measurement. (There is no measurement before the first measurement.) In the example above, the changes are as follows:</p>
+<pre><code>199 (N/A - no previous measurement)
+200 (<em>increased</em>)
+208 (<em>increased</em>)
+210 (<em>increased</em>)
+200 (decreased)
+207 (<em>increased</em>)
+240 (<em>increased</em>)
+269 (<em>increased</em>)
+260 (decreased)
+263 (<em>increased</em>)
+</code></pre>
+<p>In this example, there are <em><code>7</code></em> measurements that are larger than the previous measurement.</p>
+<p><em>How many measurements are larger than the previous measurement?</em></p>
+</article>
+<p>Your puzzle answer was <code>1754</code>.</p><article><h2 id="part2">--- Part Two ---</h2><p>Considering every single measurement isn't as useful as you expected: there's just too much noise in the data.</p>
+<p>Instead, consider sums of a <em>three-measurement sliding window</em>. Again considering the above example:</p>
+<pre><code>199 A
+200 A B
+208 A B C
+210 B C D
+200 E C D
+207 E F D
+240 E F G
+269 F G H
+260 G H
+263 H
+</code></pre>
+<p>Start by comparing the first and second three-measurement windows. The measurements in the first window are marked <code>A</code> (<code>199</code>, <code>200</code>, <code>208</code>); their sum is <code>199 + 200 + 208 = 607</code>. The second window is marked <code>B</code> (<code>200</code>, <code>208</code>, <code>210</code>); its sum is <code>618</code>. The sum of measurements in the second window is larger than the sum of the first, so this first comparison <em>increased</em>.</p>
+<p>Your goal now is to count <em>the number of times the sum of measurements in this sliding window increases</em> from the previous sum. So, compare <code>A</code> with <code>B</code>, then compare <code>B</code> with <code>C</code>, then <code>C</code> with <code>D</code>, and so on. Stop when there aren't enough measurements left to create a new three-measurement sum.</p>
+<p>In the above example, the sum of each three-measurement window is as follows:</p>
+<pre><code>A: 607 (N/A - no previous sum)
+B: 618 (<em>increased</em>)
+C: 618 (no change)
+D: 617 (decreased)
+E: 647 (<em>increased</em>)
+F: 716 (<em>increased</em>)
+G: 769 (<em>increased</em>)
+H: 792 (<em>increased</em>)
+</code></pre>
+<p>In this example, there are <em><code>5</code></em> sums that are larger than the previous sum.</p>
+<p>Consider sums of a three-measurement sliding window. <em>How many sums are larger than the previous sum?</em></p>
+</article>
+<p>Your puzzle answer was <code>1789</code>.</p><p>Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, you should <a href="https://adventofcode.com/2021">return to your Advent calendar</a> and try another puzzle.</p>
+<p>If you still want to see it, you can <a href="https://adventofcode.com/2021/day/1/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also this puzzle.</p>
+</div></div> \ No newline at end of file
diff --git a/01/problem.txt b/01/problem.txt
deleted file mode 100644
index 3ca3a3e..0000000
--- a/01/problem.txt
+++ /dev/null
@@ -1,76 +0,0 @@
---- Day 1: Sonar Sweep ---
-You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean!
-
-Before you know it, you're inside a submarine the Elves keep ready for situations like this. It's covered in Christmas lights (because of course it is), and it even has an experimental antenna that should be able to track the keys if you can boost its signal strength high enough; there's a little meter that indicates the antenna's signal strength by displaying 0-50 stars.
-
-Your instincts tell you that in order to save Christmas, you'll need to get all fifty stars by December 25th.
-
-Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
-
-As the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar sweep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine.
-
-For example, suppose you had the following report:
-
-199
-200
-208
-210
-200
-207
-240
-269
-260
-263
-This report indicates that, scanning outward from the submarine, the sonar sweep found depths of 199, 200, 208, 210, and so on.
-
-The first order of business is to figure out how quickly the depth increases, just so you know what you're dealing with - you never know if the keys will get carried into deeper water by an ocean current or a fish or something.
-
-To do this, count the number of times a depth measurement increases from the previous measurement. (There is no measurement before the first measurement.) In the example above, the changes are as follows:
-
-199 (N/A - no previous measurement)
-200 (increased)
-208 (increased)
-210 (increased)
-200 (decreased)
-207 (increased)
-240 (increased)
-269 (increased)
-260 (decreased)
-263 (increased)
-In this example, there are 7 measurements that are larger than the previous measurement.
-
-How many measurements are larger than the previous measurement?
-
---- Part Two ---
-
-Considering every single measurement isn't as useful as you expected: there's just too much noise in the data.
-
-Instead, consider sums of a three-measurement sliding window. Again considering the above example:
-
-199 A
-200 A B
-208 A B C
-210 B C D
-200 E C D
-207 E F D
-240 E F G
-269 F G H
-260 G H
-263 H
-Start by comparing the first and second three-measurement windows. The measurements in the first window are marked A (199, 200, 208); their sum is 199 + 200 + 208 = 607. The second window is marked B (200, 208, 210); its sum is 618. The sum of measurements in the second window is larger than the sum of the first, so this first comparison increased.
-
-Your goal now is to count the number of times the sum of measurements in this sliding window increases from the previous sum. So, compare A with B, then compare B with C, then C with D, and so on. Stop when there aren't enough measurements left to create a new three-measurement sum.
-
-In the above example, the sum of each three-measurement window is as follows:
-
-A: 607 (N/A - no previous sum)
-B: 618 (increased)
-C: 618 (no change)
-D: 617 (decreased)
-E: 647 (increased)
-F: 716 (increased)
-G: 769 (increased)
-H: 792 (increased)
-In this example, there are 5 sums that are larger than the previous sum.
-
-Consider sums of a three-measurement sliding window. How many sums are larger than the previous sum?
diff --git a/02/problem.html b/02/problem.html
new file mode 100644
index 0000000..04b074c
--- /dev/null
+++ b/02/problem.html
@@ -0,0 +1,76 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, text/html, charset=UTF-8" http-equiv="Content-Type">
+ </meta>
+ <title>Day 2 - Advent of Code 2021</title>
+ <style type="text/css">
+ body {
+ margin: 30px auto;
+ max-width: 650px;
+ line-height: 1.4;
+ padding: 0 10px;
+ }
+ h1, h2, h3 {
+ line-height: 1.2;
+ }
+ </style>
+</head><div id="readability-page-1" class="page"><div>
+
+<article><h2>--- Day 2: Dive! ---</h2><p>Now, you need to figure out how to <span title="Tank, I need a pilot program for a B212 helicopter.">pilot this thing</span>.</p>
+<p>It seems like the submarine can take a series of commands like <code>forward 1</code>, <code>down 2</code>, or <code>up 3</code>:</p>
+<ul>
+<li><code>forward X</code> increases the horizontal position by <code>X</code> units.</li>
+<li><code>down X</code> <em>increases</em> the depth by <code>X</code> units.</li>
+<li><code>up X</code> <em>decreases</em> the depth by <code>X</code> units.</li>
+</ul>
+<p>Note that since you're on a submarine, <code>down</code> and <code>up</code> affect your <em>depth</em>, and so they have the opposite result of what you might expect.</p>
+<p>The submarine seems to already have a planned course (your puzzle input). You should probably figure out where it's going. For example:</p>
+<pre><code>forward 5
+down 5
+forward 8
+up 3
+down 8
+forward 2
+</code></pre>
+<p>Your horizontal position and depth both start at <code>0</code>. The steps above would then modify them as follows:</p>
+<ul>
+<li><code>forward 5</code> adds <code>5</code> to your horizontal position, a total of <code>5</code>.</li>
+<li><code>down 5</code> adds <code>5</code> to your depth, resulting in a value of <code>5</code>.</li>
+<li><code>forward 8</code> adds <code>8</code> to your horizontal position, a total of <code>13</code>.</li>
+<li><code>up 3</code> decreases your depth by <code>3</code>, resulting in a value of <code>2</code>.</li>
+<li><code>down 8</code> adds <code>8</code> to your depth, resulting in a value of <code>10</code>.</li>
+<li><code>forward 2</code> adds <code>2</code> to your horizontal position, a total of <code>15</code>.</li>
+</ul>
+<p>After following these instructions, you would have a horizontal position of <code>15</code> and a depth of <code>10</code>. (Multiplying these together produces <code><em>150</em></code>.)</p>
+<p>Calculate the horizontal position and depth you would have after following the planned course. <em>What do you get if you multiply your final horizontal position by your final depth?</em></p>
+</article>
+<p>Your puzzle answer was <code>1727835</code>.</p><article><h2 id="part2">--- Part Two ---</h2><p>Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.</p>
+<p>In addition to horizontal position and depth, you'll also need to track a third value, <em>aim</em>, which also starts at <code>0</code>. The commands also mean something entirely different than you first thought:</p>
+<ul>
+<li><code>down X</code> <em>increases</em> your aim by <code>X</code> units.</li>
+<li><code>up X</code> <em>decreases</em> your aim by <code>X</code> units.</li>
+<li><code>forward X</code> does two things:<ul>
+ <li>It increases your horizontal position by <code>X</code> units.</li>
+ <li>It increases your depth by your aim <em>multiplied by</em> <code>X</code>.</li>
+</ul></li>
+</ul>
+<p>Again note that since you're on a submarine, <code>down</code> and <code>up</code> do the opposite of what you might expect: "down" means aiming in the positive direction.</p>
+<p>Now, the above example does something different:</p>
+<ul>
+<li><code>forward 5</code> adds <code>5</code> to your horizontal position, a total of <code>5</code>. Because your aim is <code>0</code>, your depth does not change.</li>
+<li><code>down 5</code> adds <code>5</code> to your aim, resulting in a value of <code>5</code>.</li>
+<li><code>forward 8</code> adds <code>8</code> to your horizontal position, a total of <code>13</code>. Because your aim is <code>5</code>, your depth increases by <code>8*5=40</code>.</li>
+<li><code>up 3</code> decreases your aim by <code>3</code>, resulting in a value of <code>2</code>.</li>
+<li><code>down 8</code> adds <code>8</code> to your aim, resulting in a value of <code>10</code>.</li>
+<li><code>forward 2</code> adds <code>2</code> to your horizontal position, a total of <code>15</code>. Because your aim is <code>10</code>, your depth increases by <code>2*10=20</code> to a total of <code>60</code>.</li>
+</ul>
+<p>After following these new instructions, you would have a horizontal position of <code>15</code> and a depth of <code>60</code>. (Multiplying these produces <code><em>900</em></code>.)</p>
+<p>Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. <em>What do you get if you multiply your final horizontal position by your final depth?</em></p>
+</article>
+<p>Your puzzle answer was <code>1544000595</code>.</p><p>Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, you should <a href="https://adventofcode.com/2021">return to your Advent calendar</a> and try another puzzle.</p>
+<p>If you still want to see it, you can <a href="https://adventofcode.com/2021/day/2/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also this puzzle.</p>
+</div></div> \ No newline at end of file
diff --git a/03/problem.html b/03/problem.html
new file mode 100644
index 0000000..11b30cf
--- /dev/null
+++ b/03/problem.html
@@ -0,0 +1,72 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, text/html, charset=UTF-8" http-equiv="Content-Type">
+ </meta>
+ <title>Day 3 - Advent of Code 2021</title>
+ <style type="text/css">
+ body {
+ margin: 30px auto;
+ max-width: 650px;
+ line-height: 1.4;
+ padding: 0 10px;
+ }
+ h1, h2, h3 {
+ line-height: 1.2;
+ }
+ </style>
+</head><div id="readability-page-1" class="page"><article><h2>--- Day 3: Binary Diagnostic ---</h2><p>The submarine has been making some <span title="Turns out oceans are heavy.">odd creaking noises</span>, so you ask it to produce a diagnostic report just in case.</p>
+<p>The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded properly, can tell you many useful things about the conditions of the submarine. The first parameter to check is the <em>power consumption</em>.</p>
+<p>You need to use the binary numbers in the diagnostic report to generate two new binary numbers (called the <em>gamma rate</em> and the <em>epsilon rate</em>). The power consumption can then be found by multiplying the gamma rate by the epsilon rate.</p>
+<p>Each bit in the gamma rate can be determined by finding the <em>most common bit in the corresponding position</em> of all numbers in the diagnostic report. For example, given the following diagnostic report:</p>
+<pre><code>00100
+11110
+10110
+10111
+10101
+01111
+00111
+11100
+10000
+11001
+00010
+01010
+</code></pre>
+<p>Considering only the first bit of each number, there are five <code>0</code> bits and seven <code>1</code> bits. Since the most common bit is <code>1</code>, the first bit of the gamma rate is <code>1</code>.</p>
+<p>The most common second bit of the numbers in the diagnostic report is <code>0</code>, so the second bit of the gamma rate is <code>0</code>.</p>
+<p>The most common value of the third, fourth, and fifth bits are <code>1</code>, <code>1</code>, and <code>0</code>, respectively, and so the final three bits of the gamma rate are <code>110</code>.</p>
+<p>So, the gamma rate is the binary number <code>10110</code>, or <code><em>22</em></code> in decimal.</p>
+<p>The epsilon rate is calculated in a similar way; rather than use the most common bit, the least common bit from each position is used. So, the epsilon rate is <code>01001</code>, or <code><em>9</em></code> in decimal. Multiplying the gamma rate (<code>22</code>) by the epsilon rate (<code>9</code>) produces the power consumption, <code><em>198</em></code>.</p>
+<p>Use the binary numbers in your diagnostic report to calculate the gamma rate and epsilon rate, then multiply them together. <em>What is the power consumption of the submarine?</em> (Be sure to represent your answer in decimal, not binary.)</p>
+</article><p>Your puzzle answer was <code>4006064</code>.</p><article><h2 id="part2">--- Part Two ---</h2><p>Next, you should verify the <em>life support rating</em>, which can be determined by multiplying the <em>oxygen generator rating</em> by the <em>CO2 scrubber rating</em>.</p>
+<p>Both the oxygen generator rating and the CO2 scrubber rating are values that can be found in your diagnostic report - finding them is the tricky part. Both values are located using a similar process that involves filtering out values until only one remains. Before searching for either rating value, start with the full list of binary numbers from your diagnostic report and <em>consider just the first bit</em> of those numbers. Then:</p>
+<ul>
+<li>Keep only numbers selected by the <em>bit criteria</em> for the type of rating value for which you are searching. Discard numbers which do not match the bit criteria.</li>
+<li>If you only have one number left, stop; this is the rating value for which you are searching.</li>
+<li>Otherwise, repeat the process, considering the next bit to the right.</li>
+</ul>
+<p>The <em>bit criteria</em> depends on which type of rating value you want to find:</p>
+<ul>
+<li>To find <em>oxygen generator rating</em>, determine the <em>most common</em> value (<code>0</code> or <code>1</code>) in the current bit position, and keep only numbers with that bit in that position. If <code>0</code> and <code>1</code> are equally common, keep values with a <code><em>1</em></code> in the position being considered.</li>
+<li>To find <em>CO2 scrubber rating</em>, determine the <em>least common</em> value (<code>0</code> or <code>1</code>) in the current bit position, and keep only numbers with that bit in that position. If <code>0</code> and <code>1</code> are equally common, keep values with a <code><em>0</em></code> in the position being considered.</li>
+</ul>
+<p>For example, to determine the <em>oxygen generator rating</em> value using the same example diagnostic report from above:</p>
+<ul>
+<li>Start with all 12 numbers and consider only the first bit of each number. There are more <code>1</code> bits (7) than <code>0</code> bits (5), so keep only the 7 numbers with a <code>1</code> in the first position: <code>11110</code>, <code>10110</code>, <code>10111</code>, <code>10101</code>, <code>11100</code>, <code>10000</code>, and <code>11001</code>.</li>
+<li>Then, consider the second bit of the 7 remaining numbers: there are more <code>0</code> bits (4) than <code>1</code> bits (3), so keep only the 4 numbers with a <code>0</code> in the second position: <code>10110</code>, <code>10111</code>, <code>10101</code>, and <code>10000</code>.</li>
+<li>In the third position, three of the four numbers have a <code>1</code>, so keep those three: <code>10110</code>, <code>10111</code>, and <code>10101</code>.</li>
+<li>In the fourth position, two of the three numbers have a <code>1</code>, so keep those two: <code>10110</code> and <code>10111</code>.</li>
+<li>In the fifth position, there are an equal number of <code>0</code> bits and <code>1</code> bits (one each). So, to find the <em>oxygen generator rating</em>, keep the number with a <code>1</code> in that position: <code>10111</code>.</li>
+<li>As there is only one number left, stop; the <em>oxygen generator rating</em> is <code>10111</code>, or <code><em>23</em></code> in decimal.</li>
+</ul>
+<p>Then, to determine the <em>CO2 scrubber rating</em> value from the same example above:</p>
+<ul>
+<li>Start again with all 12 numbers and consider only the first bit of each number. There are fewer <code>0</code> bits (5) than <code>1</code> bits (7), so keep only the 5 numbers with a <code>0</code> in the first position: <code>00100</code>, <code>01111</code>, <code>00111</code>, <code>00010</code>, and <code>01010</code>.</li>
+<li>Then, consider the second bit of the 5 remaining numbers: there are fewer <code>1</code> bits (2) than <code>0</code> bits (3), so keep only the 2 numbers with a <code>1</code> in the second position: <code>01111</code> and <code>01010</code>.</li>
+<li>In the third position, there are an equal number of <code>0</code> bits and <code>1</code> bits (one each). So, to find the <em>CO2 scrubber rating</em>, keep the number with a <code>0</code> in that position: <code>01010</code>.</li>
+<li>As there is only one number left, stop; the <em>CO2 scrubber rating</em> is <code>01010</code>, or <code><em>10</em></code> in decimal.</li>
+</ul>
+<p>Finally, to find the life support rating, multiply the oxygen generator rating (<code>23</code>) by the CO2 scrubber rating (<code>10</code>) to get <code><em>230</em></code>.</p>
+<p>Use the binary numbers in your diagnostic report to calculate the oxygen generator rating and CO2 scrubber rating, then multiply them together. <em>What is the life support rating of the submarine?</em> (Be sure to represent your answer in decimal, not binary.)</p>
+</article><p>Your puzzle answer was <code>5941884</code>.</p></div> \ No newline at end of file
diff --git a/04/problem.html b/04/problem.html
new file mode 100644
index 0000000..a7b2569
--- /dev/null
+++ b/04/problem.html
@@ -0,0 +1,71 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, text/html, charset=UTF-8" http-equiv="Content-Type">
+ </meta>
+ <title>Day 4 - Advent of Code 2021</title>
+ <style type="text/css">
+ body {
+ margin: 30px auto;
+ max-width: 650px;
+ line-height: 1.4;
+ padding: 0 10px;
+ }
+ h1, h2, h3 {
+ line-height: 1.2;
+ }
+ </style>
+</head><div id="readability-page-1" class="page"><article><h2>--- Day 4: Giant Squid ---</h2><p>You're already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can't see any sunlight. What you <em>can</em> see, however, is a giant squid that has attached itself to the outside of your submarine.</p>
+<p>Maybe it wants to play <a href="https://en.wikipedia.org/wiki/Bingo_(American_version)" target="_blank">bingo</a>?</p>
+<p>Bingo is played on a set of boards each consisting of a 5x5 grid of numbers. Numbers are chosen at random, and the chosen number is <em>marked</em> on all boards on which it appears. (Numbers may not appear on all boards.) If all numbers in any row or any column of a board are marked, that board <em>wins</em>. (Diagonals don't count.)</p>
+<p>The submarine has a <em>bingo subsystem</em> to help passengers (currently, you and the giant squid) pass the time. It automatically generates a random order in which to draw numbers and a random set of boards (your puzzle input). For example:</p>
+<pre><code>7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
+
+22 13 17 11 0
+ 8 2 23 4 24
+21 9 14 16 7
+ 6 10 3 18 5
+ 1 12 20 15 19
+
+ 3 15 0 2 22
+ 9 18 13 17 5
+19 8 7 25 23
+20 11 10 24 4
+14 21 16 12 6
+
+14 21 17 24 4
+10 16 15 9 19
+18 8 23 26 20
+22 11 13 6 5
+ 2 0 12 3 7
+</code></pre>
+<p>After the first five numbers are drawn (<code>7</code>, <code>4</code>, <code>9</code>, <code>5</code>, and <code>11</code>), there are no winners, but the boards are marked as follows (shown here adjacent to each other to save space):</p>
+<pre><code>22 13 17 <em>11</em> 0 3 15 0 2 22 14 21 17 24 <em>4</em>
+ 8 2 23 <em>4</em> 24 <em>9</em> 18 13 17 <em>5</em> 10 16 15 <em>9</em> 19
+21 <em>9</em> 14 16 <em>7</em> 19 8 <em>7</em> 25 23 18 8 23 26 20
+ 6 10 3 18 <em>5</em> 20 <em>11</em> 10 24 <em>4</em> 22 <em>11</em> 13 6 <em>5</em>
+ 1 12 20 15 19 14 21 16 12 6 2 0 12 3 <em>7</em>
+</code></pre>
+<p>After the next six numbers are drawn (<code>17</code>, <code>23</code>, <code>2</code>, <code>0</code>, <code>14</code>, and <code>21</code>), there are still no winners:</p>
+<pre><code>22 13 <em>17</em> <em>11</em> <em>0</em> 3 15 <em>0</em> <em>2</em> 22 <em>14</em> <em>21</em> <em>17</em> 24 <em>4</em>
+ 8 <em>2</em> <em>23</em> <em>4</em> 24 <em>9</em> 18 13 <em>17</em> <em>5</em> 10 16 15 <em>9</em> 19
+<em>21</em> <em>9</em> <em>14</em> 16 <em>7</em> 19 8 <em>7</em> 25 <em>23</em> 18 8 <em>23</em> 26 20
+ 6 10 3 18 <em>5</em> 20 <em>11</em> 10 24 <em>4</em> 22 <em>11</em> 13 6 <em>5</em>
+ 1 12 20 15 19 <em>14</em> <em>21</em> 16 12 6 <em>2</em> <em>0</em> 12 3 <em>7</em>
+</code></pre>
+<p>Finally, <code>24</code> is drawn:</p>
+<pre><code>22 13 <em>17</em> <em>11</em> <em>0</em> 3 15 <em>0</em> <em>2</em> 22 <em>14</em> <em>21</em> <em>17</em> <em>24</em> <em>4</em>
+ 8 <em>2</em> <em>23</em> <em>4</em> <em>24</em> <em>9</em> 18 13 <em>17</em> <em>5</em> 10 16 15 <em>9</em> 19
+<em>21</em> <em>9</em> <em>14</em> 16 <em>7</em> 19 8 <em>7</em> 25 <em>23</em> 18 8 <em>23</em> 26 20
+ 6 10 3 18 <em>5</em> 20 <em>11</em> 10 <em>24</em> <em>4</em> 22 <em>11</em> 13 6 <em>5</em>
+ 1 12 20 15 19 <em>14</em> <em>21</em> 16 12 6 <em>2</em> <em>0</em> 12 3 <em>7</em>
+</code></pre>
+<p>At this point, the third board <em>wins</em> because it has at least one complete row or column of marked numbers (in this case, the entire top row is marked: <code><em>14 21 17 24 4</em></code>).</p>
+<p>The <em>score</em> of the winning board can now be calculated. Start by finding the <em>sum of all unmarked numbers</em> on that board; in this case, the sum is <code>188</code>. Then, multiply that sum by <em>the number that was just called</em> when the board won, <code>24</code>, to get the final score, <code>188 * 24 = <em>4512</em></code>.</p>
+<p>To guarantee victory against the giant squid, figure out which board will win first. <em>What will your final score be if you choose that board?</em></p>
+</article><p>Your puzzle answer was <code>60368</code>.</p><article><h2 id="part2">--- Part Two ---</h2><p>On the other hand, it might be wise to try a different strategy: <span title="That's 'cuz a submarine don't pull things' antennas out of their sockets when they lose. Giant squid are known to do that.">let the giant squid win</span>.</p>
+<p>You aren't sure how many bingo boards a giant squid could play at once, so rather than waste time counting its arms, the safe thing to do is to <em>figure out which board will win last</em> and choose that one. That way, no matter which boards it picks, it will win for sure.</p>
+<p>In the above example, the second board is the last to win, which happens after <code>13</code> is eventually called and its middle column is completely marked. If you were to keep playing until this point, the second board would have a sum of unmarked numbers equal to <code>148</code> for a final score of <code>148 * 13 = <em>1924</em></code>.</p>
+<p>Figure out which board will win last. <em>Once it wins, what would its final score be?</em></p>
+</article><p>Your puzzle answer was <code>17435</code>.</p></div> \ No newline at end of file
diff --git a/05/problem.html b/05/problem.html
new file mode 100644
index 0000000..e098891
--- /dev/null
+++ b/05/problem.html
@@ -0,0 +1,73 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, text/html, charset=UTF-8" http-equiv="Content-Type">
+ </meta>
+ <title>Day 5 - Advent of Code 2021</title>
+ <style type="text/css">
+ body {
+ margin: 30px auto;
+ max-width: 650px;
+ line-height: 1.4;
+ padding: 0 10px;
+ }
+ h1, h2, h3 {
+ line-height: 1.2;
+ }
+ </style>
+</head><div id="readability-page-1" class="page"><article><h2>--- Day 5: Hydrothermal Venture ---</h2><p>You come across a field of <a href="https://en.wikipedia.org/wiki/Hydrothermal_vent" target="_blank">hydrothermal vents</a> on the ocean floor! These vents constantly produce large, opaque clouds, so it would be best to avoid them if possible.</p>
+<p>They tend to form in <em>lines</em>; the submarine helpfully produces a list of nearby <span title="Maybe they're Bresenham vents.">lines of vents</span> (your puzzle input) for you to review. For example:</p>
+<pre><code>0,9 -&gt; 5,9
+8,0 -&gt; 0,8
+9,4 -&gt; 3,4
+2,2 -&gt; 2,1
+7,0 -&gt; 7,4
+6,4 -&gt; 2,0
+0,9 -&gt; 2,9
+3,4 -&gt; 1,4
+0,0 -&gt; 8,8
+5,5 -&gt; 8,2
+</code></pre>
+<p>Each line of vents is given as a line segment in the format <code>x1,y1 -&gt; x2,y2</code> where <code>x1</code>,<code>y1</code> are the coordinates of one end the line segment and <code>x2</code>,<code>y2</code> are the coordinates of the other end. These line segments include the points at both ends. In other words:</p>
+<ul>
+<li>An entry like <code>1,1 -&gt; 1,3</code> covers points <code>1,1</code>, <code>1,2</code>, and <code>1,3</code>.</li>
+<li>An entry like <code>9,7 -&gt; 7,7</code> covers points <code>9,7</code>, <code>8,7</code>, and <code>7,7</code>.</li>
+</ul>
+<p>For now, <em>only consider horizontal and vertical lines</em>: lines where either <code>x1 = x2</code> or <code>y1 = y2</code>.</p>
+<p>So, the horizontal and vertical lines from the above list would produce the following diagram:</p>
+<pre><code>.......1..
+..1....1..
+..1....1..
+.......1..
+.112111211
+..........
+..........
+..........
+..........
+222111....
+</code></pre>
+<p>In this diagram, the top left corner is <code>0,0</code> and the bottom right corner is <code>9,9</code>. Each position is shown as <em>the number of lines which cover that point</em> or <code>.</code> if no line covers that point. The top-left pair of <code>1</code>s, for example, comes from <code>2,2 -&gt; 2,1</code>; the very bottom row is formed by the overlapping lines <code>0,9 -&gt; 5,9</code> and <code>0,9 -&gt; 2,9</code>.</p>
+<p>To avoid the most dangerous areas, you need to determine <em>the number of points where at least two lines overlap</em>. In the above example, this is anywhere in the diagram with a <code>2</code> or larger - a total of <code><em>5</em></code> points.</p>
+<p>Consider only horizontal and vertical lines. <em>At how many points do at least two lines overlap?</em></p>
+</article><p>Your puzzle answer was <code>5774</code>.</p><article><h2 id="part2">--- Part Two ---</h2><p>Unfortunately, considering only horizontal and vertical lines doesn't give you the full picture; you need to also consider <em>diagonal lines</em>.</p>
+<p>Because of the limits of the hydrothermal vent mapping system, the lines in your list will only ever be horizontal, vertical, or a diagonal line at exactly 45 degrees. In other words:</p>
+<ul>
+<li>An entry like <code>1,1 -&gt; 3,3</code> covers points <code>1,1</code>, <code>2,2</code>, and <code>3,3</code>.</li>
+<li>An entry like <code>9,7 -&gt; 7,9</code> covers points <code>9,7</code>, <code>8,8</code>, and <code>7,9</code>.</li>
+</ul>
+<p>Considering all lines from the above example would now produce the following diagram:</p>
+<pre><code>1.1....11.
+.111...2..
+..2.1.111.
+...1.2.2..
+.1