Fix the function reading lines for day 1.
authorGreg Burri <greg.burri@gmail.com>
Wed, 9 Dec 2020 13:07:43 +0000 (14:07 +0100)
committerGreg Burri <greg.burri@gmail.com>
Wed, 9 Dec 2020 13:07:43 +0000 (14:07 +0100)
advent_of_code_2020.jl
advent_of_code_2020.jl.html

index 3bbe26f..e1f2303 100644 (file)
@@ -28,7 +28,7 @@ See [Advent Of Code 2020](https://adventofcode.com/2020) for more information.
 md"## Day 1"
 
 # ╔═╡ 877b32e0-3315-11eb-0e96-650b19da693e
-input_day1 = parse.(Int64, split(readline("data/day01.txt"))) |> sort
+input_day1 = parse.(Int64, readlines("data/day01.txt")) |> sort
 
 # ╔═╡ 4adcf8d0-33a8-11eb-0220-696f06894ef3
 function day1_part1(input)
@@ -58,10 +58,10 @@ function day1_part2(input)
 end
 
 # ╔═╡ 7a037310-33ac-11eb-34fb-9bf552883937
-md"**Result for part 1:** $(day1_part1(input_day1))"
+md"
+**Result for part 1:** $(day1_part1(input_day1))
 
-# ╔═╡ c7dcdae0-33b1-11eb-2cab-fbc06c8ef76b
-md"**Result for part 2:** $(day1_part2(input_day1))"
+**Result for part 2:** $(day1_part2(input_day1))"
 
 # ╔═╡ 5d9712b0-3472-11eb-1423-719331dfe52f
 md"## Day 2"
@@ -611,11 +611,10 @@ md"
 # ╟─661be9a0-353b-11eb-3598-a5b5245368cb
 # ╟─f0dd4400-3313-11eb-3295-af913c2212fb
 # ╟─0b7b8920-3314-11eb-2cfb-7d20c0967e67
-# â\95 â\95\90877b32e0-3315-11eb-0e96-650b19da693e
+# â\95\9fâ\94\80877b32e0-3315-11eb-0e96-650b19da693e
 # ╠═4adcf8d0-33a8-11eb-0220-696f06894ef3
 # ╠═1e8e7230-33ae-11eb-0a77-035e6a4b9ba8
 # ╟─7a037310-33ac-11eb-34fb-9bf552883937
-# ╟─c7dcdae0-33b1-11eb-2cab-fbc06c8ef76b
 # ╟─5d9712b0-3472-11eb-1423-719331dfe52f
 # ╠═b9144990-3473-11eb-0ba9-59f3fe6ddbc0
 # ╠═bbda1c1e-347a-11eb-0e7a-756906c4c9f4
index 6d22326..1bb5451 100644 (file)
@@ -166,9 +166,9 @@ main {
 </ul>
 <p>See <a href="https://adventofcode.com/2020">Advent Of Code 2020</a> for more information.</p>
 </div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">12.7&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="0b7b8920-3314-11eb-2cfb-7d20c0967e67"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><h2>Day 1</h2>
-</div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">8.8&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="877b32e0-3315-11eb-0e96-650b19da693e"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="" mime="application/vnd.pluto.tree+object"><assignee>input_day1</assignee><div><jltree class="collapsed">Int64<jlarray class="Array"><r><k>1</k><v><pre>1254</pre></v></r></jlarray></jltree></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>1</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-variable">input_day1</span> <span class="cm-operator">=</span> <span class="cm-variable">parse</span><span class="cm-operator">.</span>(<span class="cm-variable">Int64</span>, <span class="cm-builtin">split</span>(<span class="cm-builtin">readline</span>(<span class="cm-string">"data/day01.txt"</span>))) <span class="cm-operator">|&gt;</span> <span class="cm-variable">sort</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 23px;"></div><div class="CodeMirror-gutters" style="height: 56px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">36.5&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="4adcf8d0-33a8-11eb-0220-696f06894ef3"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>day1_part1 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 20px; left: 217.6px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style=""><div class="CodeMirror-cursor" style="left: 187.6px; top: 15px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">function</span> <span class="cm-def">day1_part1</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">n</span> <span class="cm-operator">∈</span> <span class="cm-variable">input</span><span class="cm-tab" role="presentation" cm-text="       ">   </span><span class="cm-tab" role="presentation" cm-text="  ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">r</span> <span class="cm-operator">=</span> <span class="cm-builtin">searchsorted</span>(<span class="cm-variable">input_day1</span>, <span class="cm-number">2020</span> <span class="cm-operator">-</span> <span class="cm-variable">n</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span> <span class="cm-operator">≤</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">stop</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">return</span> <span class="cm-variable">n</span> <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="       ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 128px;"></div><div class="CodeMirror-gutters" style="height: 161px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">73.9&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="1e8e7230-33ae-11eb-0a77-035e6a4b9ba8"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>day1_part2 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>15</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">function</span> <span class="cm-def">day1_part2</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-variable">l</span> <span class="cm-operator">=</span> <span class="cm-builtin">length</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">i</span> <span class="cm-operator">∈</span> <span class="cm-number">1</span><span class="cm-operator">:</span><span class="cm-variable">l</span><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-tab" role="presentation" cm-text="    ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">j</span> <span class="cm-operator">∈</span> <span class="cm-variable">i</span><span class="cm-operator">+</span><span class="cm-number">1</span><span class="cm-operator">:</span><span class="cm-variable">l</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">v</span> <span class="cm-operator">=</span> <span class="cm-number">2020</span> <span class="cm-operator">-</span> <span class="cm-variable">input</span>[<span class="cm-variable">i</span>] <span class="cm-operator">-</span> <span class="cm-variable">input</span>[<span class="cm-variable">j</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">v</span> <span class="cm-operator">≤</span> <span class="cm-number">0</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">break</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">r</span> <span class="cm-operator">=</span> <span class="cm-builtin">searchsorted</span>(<span class="cm-variable">input_day1</span>, <span class="cm-variable">v</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span> <span class="cm-operator">≤</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">stop</span><span class="cm-tab" role="presentation" cm-text="     "> </span><span class="cm-tab" role="presentation" cm-text="    ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="     ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">return</span> <span class="cm-variable">input</span>[<span class="cm-variable">i</span>] <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">j</span>] <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 233px;"></div><div class="CodeMirror-gutters" style="height: 266px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">92.2&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="7a037310-33ac-11eb-34fb-9bf552883937"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><p><strong>Result for part 1:</strong> nothing</p>
-</div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">95.6&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="c7dcdae0-33b1-11eb-2cab-fbc06c8ef76b"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><p><strong>Result for part 2:</strong> nothing</p>
-</div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">23.2&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="5d9712b0-3472-11eb-1423-719331dfe52f"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><h2>Day 2</h2>
+</div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">8.8&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="877b32e0-3315-11eb-0e96-650b19da693e"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="" mime="application/vnd.pluto.tree+object"><assignee>input_day1</assignee><div><jltree class="collapsed">Int64<jlarray class="Array"><r><k>1</k><v><pre>156</pre></v></r><r><k>2</k><v><pre>413</pre></v></r><r><k>3</k><v><pre>444</pre></v></r><r><k>4</k><v><pre>508</pre></v></r><r><k>5</k><v><pre>684</pre></v></r><r><k>6</k><v><pre>847</pre></v></r><r><k>7</k><v><pre>900</pre></v></r><r><k>8</k><v><pre>961</pre></v></r><r><k>9</k><v><pre>1068</pre></v></r><r><k>10</k><v><pre>1083</pre></v></r><r><k>11</k><v><pre>1094</pre></v></r><r><k>12</k><v><pre>1105</pre></v></r><r><k>13</k><v><pre>1123</pre></v></r><r><k>14</k><v><pre>1130</pre></v></r><r><k>15</k><v><pre>1137</pre></v></r><r><k>16</k><v><pre>1140</pre></v></r><r><k>17</k><v><pre>1146</pre></v></r><r><k>18</k><v><pre>1154</pre></v></r><r><k>19</k><v><pre>1157</pre></v></r><r><k>20</k><v><pre>1165</pre></v></r><r><jlmore class="">more</jlmore></r><r><k>191</k><v><pre>1986</pre></v></r><r><k>192</k><v><pre>1990</pre></v></r><r><k>193</k><v><pre>1991</pre></v></r><r><k>194</k><v><pre>1994</pre></v></r><r><k>195</k><v><pre>1995</pre></v></r><r><k>196</k><v><pre>1999</pre></v></r><r><k>197</k><v><pre>2000</pre></v></r><r><k>198</k><v><pre>2001</pre></v></r><r><k>199</k><v><pre>2005</pre></v></r><r><k>200</k><v><pre>2007</pre></v></r></jlarray></jltree></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">39.2&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="4adcf8d0-33a8-11eb-0220-696f06894ef3"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>day1_part1 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 50px; left: 240.55px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 210.55px; top: 45px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">function</span> <span class="cm-def">day1_part1</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">n</span> <span class="cm-operator">∈</span> <span class="cm-variable">input</span><span class="cm-tab" role="presentation" cm-text="       ">   </span><span class="cm-tab" role="presentation" cm-text="  ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">r</span> <span class="cm-operator">=</span> <span class="cm-builtin">searchsorted</span>(<span class="cm-variable">input_day1</span>, <span class="cm-number">2020</span> <span class="cm-operator">-</span> <span class="cm-variable">n</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span> <span class="cm-operator">≤</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">stop</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">return</span> <span class="cm-variable">n</span> <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="       ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 128px;"></div><div class="CodeMirror-gutters" style="height: 161px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">36.2&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="1e8e7230-33ae-11eb-0a77-035e6a4b9ba8"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>day1_part2 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 95px; left: 194.65px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 164.65px; top: 90px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">function</span> <span class="cm-def">day1_part2</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-variable">l</span> <span class="cm-operator">=</span> <span class="cm-builtin">length</span>(<span class="cm-variable">input</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">i</span> <span class="cm-operator">∈</span> <span class="cm-number">1</span><span class="cm-operator">:</span><span class="cm-variable">l</span><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-tab" role="presentation" cm-text="    ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">for</span> <span class="cm-variable">j</span> <span class="cm-operator">∈</span> <span class="cm-variable">i</span><span class="cm-operator">+</span><span class="cm-number">1</span><span class="cm-operator">:</span><span class="cm-variable">l</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">v</span> <span class="cm-operator">=</span> <span class="cm-number">2020</span> <span class="cm-operator">-</span> <span class="cm-variable">input</span>[<span class="cm-variable">i</span>] <span class="cm-operator">-</span> <span class="cm-variable">input</span>[<span class="cm-variable">j</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">v</span> <span class="cm-operator">≤</span> <span class="cm-number">0</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">break</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">r</span> <span class="cm-operator">=</span> <span class="cm-builtin">searchsorted</span>(<span class="cm-variable">input_day1</span>, <span class="cm-variable">v</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">if</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span> <span class="cm-operator">≤</span> <span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">stop</span><span class="cm-tab" role="presentation" cm-text="     "> </span><span class="cm-tab" role="presentation" cm-text="    ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="     ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">return</span> <span class="cm-variable">input</span>[<span class="cm-variable">i</span>] <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">j</span>] <span class="cm-operator">*</span> <span class="cm-variable">input</span>[<span class="cm-variable">r</span><span class="cm-operator">.</span><span class="cm-variable">start</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 233px;"></div><div class="CodeMirror-gutters" style="height: 266px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">42.9&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="7a037310-33ac-11eb-34fb-9bf552883937"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><p><strong>Result for part 1:</strong> 913824</p>
+<p><strong>Result for part 2:</strong> 240889536</p>
+</div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">30.0&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="5d9712b0-3472-11eb-1423-719331dfe52f"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><h2>Day 2</h2>
 </div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">10.3&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="b9144990-3473-11eb-0ba9-59f3fe6ddbc0"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y rich_output " mime="text/plain"><assignee></assignee><div></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>5</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">struct</span> <span class="cm-def">Password</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="       ">    </span><span class="cm-variable">policy_range</span> <span class="cm-builtin">::</span> <span class="cm-variable">UnitRange</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="   ">    </span><span class="cm-variable">policy_char</span> <span class="cm-builtin">::</span> <span class="cm-variable">Char</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">p</span> <span class="cm-builtin">::</span> <span class="cm-variable">String</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span><span class="cm-tab" role="presentation" cm-text="      "> </span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 83px;"></div><div class="CodeMirror-gutters" style="height: 116px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">520&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="bbda1c1e-347a-11eb-0e7a-756906c4c9f4"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>nb_of_valid_passwords_part2 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>7</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-def">nb_of_valid_passwords_part2</span>(<span class="cm-variable">passwords</span>) <span class="cm-operator">=</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-builtin">count</span>(</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">password</span> <span class="cm-operator">-&gt;</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span>(<span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">p</span>[<span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_range</span><span class="cm-operator">.</span><span class="cm-variable">start</span>] <span class="cm-operator">==</span> <span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_char</span>) <span class="cm-operator">⊻</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span>(<span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">p</span>[<span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_range</span><span class="cm-operator">.</span><span class="cm-variable">stop</span>] <span class="cm-operator">==</span> <span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_char</span>),</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">passwords</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span>)</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 113px;"></div><div class="CodeMirror-gutters" style="height: 146px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">54.3&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="10f5ffa0-3474-11eb-2a36-d5c6f78f18c6"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>parse_day2 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>14</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">function</span> <span class="cm-def">parse_day2</span>(<span class="cm-variable">lines</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span><span class="cm-variable">line_regexp</span> <span class="cm-operator">=</span> <span class="cm-string">r"^(\d+)-(\d+) ([a-z]): ([a-z]+)$"</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="     ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-keyword">function</span> <span class="cm-def">parse_line</span>(<span class="cm-variable">line</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">m</span> <span class="cm-operator">=</span> <span class="cm-builtin">match</span>(<span class="cm-variable">line_regexp</span>, <span class="cm-variable">line</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-builtin">Password</span>(</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="     ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-builtin">UnitRange</span>(<span class="cm-builtin">parse</span>(<span class="cm-variable">Int</span>, <span class="cm-variable">m</span><span class="cm-operator">.</span><span class="cm-variable">captures</span>[<span class="cm-number">1</span>]), <span class="cm-builtin">parse</span>(<span class="cm-variable">Int</span>, <span class="cm-variable">m</span><span class="cm-operator">.</span><span class="cm-variable">captures</span>[<span class="cm-number">2</span>])),</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">m</span><span class="cm-operator">.</span><span class="cm-variable">captures</span>[<span class="cm-number">3</span>][<span class="cm-number">1</span>],</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">m</span><span class="cm-operator">.</span><span class="cm-variable">captures</span>[<span class="cm-number">4</span>]</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="      ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-keyword">end</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="  ">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="     ">    </span><span class="cm-variable">parse_line</span><span class="cm-operator">.</span>(<span class="cm-variable">lines</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 218px;"></div><div class="CodeMirror-gutters" style="height: 251px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">51.0&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="" id="6695038e-3472-11eb-1846-3b1c041be59d"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="scroll_y " mime="text/plain"><assignee></assignee><div><pre><code>nb_of_valid_passwords_part1 (generic function with 1 method)</code></pre></div></pluto-output><pluto-input><button class="delete_cell" title="Delete cell"><span></span></button><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="none" spellcheck="false" tabindex="0" wrap="off"></textarea></div><div class="CodeMirror-vscrollbar" tabindex="-1" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" tabindex="-1" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="true"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 33px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div style="position: relative; outline: currentcolor none medium;" role="presentation"><div class="CodeMirror-measure"><pre class="CodeMirror-line-like"><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>5</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 15px;">&nbsp;</div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-def">nb_of_valid_passwords_part1</span>(<span class="cm-variable">passwords</span>) <span class="cm-operator">=</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-builtin">count</span>(</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="        ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">password</span> <span class="cm-operator">-&gt;</span> <span class="cm-builtin">count</span>(<span class="cm-operator">==</span>(<span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_char</span>), <span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">p</span>) <span class="cm-operator">∈</span> <span class="cm-variable">password</span><span class="cm-operator">.</span><span class="cm-variable">policy_range</span>,</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span><span class="cm-tab" role="presentation" cm-text=" ">    </span><span class="cm-variable">passwords</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text="    ">    </span>)</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 33px; width: 1px; border-bottom: 0px solid transparent; top: 83px;"></div><div class="CodeMirror-gutters" style="height: 116px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></pluto-input><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">39.7&nbsp;μs</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="a0cfb670-3474-11eb-1a05-c12914658a0a"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><p>Test 1, part 1: true      </p>
 <p>Test 1, part 2: true</p>
 </div></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">187&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="4a629040-347a-11eb-2aae-6f37a4c89168"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="" mime="application/vnd.pluto.tree+object"><assignee>input_day2</assignee><div><jltree class="collapsed">Main.workspace219.Password<jlarray class="Array"><r><k>1</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:13</pre></v></r><r><k>policy_char</k><v><pre>'r'</pre></v></r><r><k>p</k><v><pre>"gqdrspndrpsrjfjx"</pre></v></r></jlstruct></jltree></v></r><r><k>2</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>5:16</pre></v></r><r><k>policy_char</k><v><pre>'j'</pre></v></r><r><k>p</k><v><pre>"jjjjkjjzjjjjjfjzjjj"</pre></v></r></jlstruct></jltree></v></r><r><k>3</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>14:16</pre></v></r><r><k>policy_char</k><v><pre>'r'</pre></v></r><r><k>p</k><v><pre>"rrrnrrrrrcnrgxrr"</pre></v></r></jlstruct></jltree></v></r><r><k>4</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:3</pre></v></r><r><k>policy_char</k><v><pre>'k'</pre></v></r><r><k>p</k><v><pre>"bkktwhgktv"</pre></v></r></jlstruct></jltree></v></r><r><k>5</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>3:5</pre></v></r><r><k>policy_char</k><v><pre>'q'</pre></v></r><r><k>p</k><v><pre>"dxqqqzmqvs"</pre></v></r></jlstruct></jltree></v></r><r><k>6</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>11:14</pre></v></r><r><k>policy_char</k><v><pre>'s'</pre></v></r><r><k>p</k><v><pre>"sssssssssssssv"</pre></v></r></jlstruct></jltree></v></r><r><k>7</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:3</pre></v></r><r><k>policy_char</k><v><pre>'d'</pre></v></r><r><k>p</k><v><pre>"cdzdq"</pre></v></r></jlstruct></jltree></v></r><r><k>8</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>13:16</pre></v></r><r><k>policy_char</k><v><pre>'q'</pre></v></r><r><k>p</k><v><pre>"scdqpdgpkvbwwqbv"</pre></v></r></jlstruct></jltree></v></r><r><k>9</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>9:10</pre></v></r><r><k>policy_char</k><v><pre>'d'</pre></v></r><r><k>p</k><v><pre>"ddrdddlddd"</pre></v></r></jlstruct></jltree></v></r><r><k>10</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>15:17</pre></v></r><r><k>policy_char</k><v><pre>'v'</pre></v></r><r><k>p</k><v><pre>"jvvvvvvgcvvvvrcvnv"</pre></v></r></jlstruct></jltree></v></r><r><k>11</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>2:3</pre></v></r><r><k>policy_char</k><v><pre>'s'</pre></v></r><r><k>p</k><v><pre>"xssx"</pre></v></r></jlstruct></jltree></v></r><r><k>12</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>8:15</pre></v></r><r><k>policy_char</k><v><pre>'j'</pre></v></r><r><k>p</k><v><pre>"jwjjjjkhjjjltjmjjjr"</pre></v></r></jlstruct></jltree></v></r><r><k>13</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>7:15</pre></v></r><r><k>policy_char</k><v><pre>'m'</pre></v></r><r><k>p</k><v><pre>"wqspfmtpjftmplwp"</pre></v></r></jlstruct></jltree></v></r><r><k>14</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:11</pre></v></r><r><k>policy_char</k><v><pre>'s'</pre></v></r><r><k>p</k><v><pre>"swdgzhgsxtssndzfm"</pre></v></r></jlstruct></jltree></v></r><r><k>15</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>3:4</pre></v></r><r><k>policy_char</k><v><pre>'b'</pre></v></r><r><k>p</k><v><pre>"bgjrg"</pre></v></r></jlstruct></jltree></v></r><r><k>16</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:12</pre></v></r><r><k>policy_char</k><v><pre>'x'</pre></v></r><r><k>p</k><v><pre>"jxgxxxpjwpsht"</pre></v></r></jlstruct></jltree></v></r><r><k>17</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>5:15</pre></v></r><r><k>policy_char</k><v><pre>'x'</pre></v></r><r><k>p</k><v><pre>"xxjxwshpxjxxxxsnxvz"</pre></v></r></jlstruct></jltree></v></r><r><k>18</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>4:11</pre></v></r><r><k>policy_char</k><v><pre>'r'</pre></v></r><r><k>p</k><v><pre>"bjnrpswfprrng"</pre></v></r></jlstruct></jltree></v></r><r><k>19</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>12:14</pre></v></r><r><k>policy_char</k><v><pre>'j'</pre></v></r><r><k>p</k><v><pre>"wjjzmwnmmvzsjhnnkj"</pre></v></r></jlstruct></jltree></v></r><r><k>20</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>3:4</pre></v></r><r><k>policy_char</k><v><pre>'d'</pre></v></r><r><k>p</k><v><pre>"dddv"</pre></v></r></jlstruct></jltree></v></r><r><jlmore class="">more</jlmore></r><r><k>991</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>14:15</pre></v></r><r><k>policy_char</k><v><pre>'z'</pre></v></r><r><k>p</k><v><pre>"nlzzzzzzzzzdzzzzzz"</pre></v></r></jlstruct></jltree></v></r><r><k>992</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>8:12</pre></v></r><r><k>policy_char</k><v><pre>'r'</pre></v></r><r><k>p</k><v><pre>"zrrrrprrxrrrrkrhk"</pre></v></r></jlstruct></jltree></v></r><r><k>993</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:2</pre></v></r><r><k>policy_char</k><v><pre>'z'</pre></v></r><r><k>p</k><v><pre>"qlfzd"</pre></v></r></jlstruct></jltree></v></r><r><k>994</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:6</pre></v></r><r><k>policy_char</k><v><pre>'j'</pre></v></r><r><k>p</k><v><pre>"kqjpjzpsgjjqz"</pre></v></r></jlstruct></jltree></v></r><r><k>995</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>1:5</pre></v></r><r><k>policy_char</k><v><pre>'s'</pre></v></r><r><k>p</k><v><pre>"qfssks"</pre></v></r></jlstruct></jltree></v></r><r><k>996</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>2:5</pre></v></r><r><k>policy_char</k><v><pre>'r'</pre></v></r><r><k>p</k><v><pre>"nrrzrr"</pre></v></r></jlstruct></jltree></v></r><r><k>997</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>4:6</pre></v></r><r><k>policy_char</k><v><pre>'g'</pre></v></r><r><k>p</k><v><pre>"kggggg"</pre></v></r></jlstruct></jltree></v></r><r><k>998</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>6:7</pre></v></r><r><k>policy_char</k><v><pre>'c'</pre></v></r><r><k>p</k><v><pre>"cccccdqcc"</pre></v></r></jlstruct></jltree></v></r><r><k>999</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>2:6</pre></v></r><r><k>policy_char</k><v><pre>'x'</pre></v></r><r><k>p</k><v><pre>"vjkxbrfwnj"</pre></v></r></jlstruct></jltree></v></r><r><k>1000</k><v><jltree class="collapsed">Password<jlstruct><r><k>policy_range</k><v><pre>16:18</pre></v></r><r><k>policy_char</k><v><pre>'s'</pre></v></r><r><k>p</k><v><pre>"kssssssswssssssssssb"</pre></v></r></jlstruct></jltree></v></r></jlarray></jltree></div></pluto-output><pluto-runarea><button class="runcell" title="Run"><span></span></button><span class="runtime">11.0&nbsp;ms</span></pluto-runarea><button class="add_cell after" title="Add cell"><span></span></button></pluto-cell><pluto-cell class="code_folded " id="5825aa50-347a-11eb-37ca-811e1b59d37a"><pluto-shoulder draggable="true" title="Drag to move cell"><button class="foldcode" title="Show/hide code"><span></span></button></pluto-shoulder><pluto-trafficlight></pluto-trafficlight><button class="add_cell before" title="Add cell"><span></span></button><pluto-output class="rich_output " mime="text/html"><assignee></assignee><div><div class="markdown"><p><strong>Result for part 1</strong>: 600</p>