<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="348201" data-post-id="348201">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adamu" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/adamu/120/31482_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adamu
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>More regexes.</p>
<p>I’m not sure why <code>do</code> produces <code>["", "", "do()"]</code> and <code>don't</code> produces <code>["", "", "", "don't()"]</code>. The number of empty strings is consistent, but my regex-fu is not enough to figure out why / prevent it.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def part1(input) do
  Regex.scan(~r/mul\((\d+),(\d+)\)/, input, capture: :all_but_first)
  |&gt; Enum.map(fn [a, b] -&gt; String.to_integer(a) * String.to_integer(b) end)
  |&gt; Enum.sum()
end

def part2(input) do
  Regex.scan(~r/mul\((\d+),(\d+)\)|(do\(\))|(don't\(\))/, input, capture: :all_but_first)
  |&gt; Enum.reduce({0, :process}, fn
    ["", "", "do()"], {sum, _} -&gt; {sum, :process}
    ["", "", "", "don't()"], {sum, _} -&gt; {sum, :skip}
    _, {sum, :skip} -&gt; {sum, :skip}
    [a, b], {sum, :process} -&gt; {sum + String.to_integer(a) * String.to_integer(b), :process}
  end)
  |&gt; elem(0)
end
</code></pre>
<p><a href="https://git.adamu.jp/adam/AdventOfCode/src/branch/main/2024/day3.exs" class="onebox" target="_blank" rel="noopener nofollow ugc">https://git.adamu.jp/adam/AdventOfCode/src/branch/main/2024/day3.exs</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348201" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-348201" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348201"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="348204" data-post-id="348204">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="code-shoily" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/code-shoily/120/8052_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  code-shoily
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Empty placeholder for the preceding “do()” in the regex |-s. If you swap them then you will see the reverse scenario</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348204" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-348204" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348204"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="348205" data-post-id="348205">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Aetherus" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Aetherus/120/17203_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Aetherus
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Because <code>(do\(\))</code> is the 3rd capture group, and <code>(don't\(\))</code> is the 4th in your regex.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348205" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-348205" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348205"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="348206" data-post-id="348206">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I wanted to do binary parsing as well but the regexes are too convenient here, so quick solution like a lot in this thread:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule AdventOfCode.Solutions.Y24.Day03 do
  alias AoC.Input

  def parse(input, _part) do
    String.trim(Input.read!(input))
  end

  def part_one(problem) do
    ~r/mul\(([0-9]{1,3}),([0-9]{1,3})\)/
    |&gt; Regex.scan(problem)
    |&gt; Enum.reduce(0, fn [_, a, b], acc -&gt;
      String.to_integer(a) * String.to_integer(b) + acc
    end)
  end

  def part_two(problem) do
    ~r/(mul\(([0-9]{1,3}),([0-9]{1,3})\)|do\(\)|don't\(\))/
    |&gt; Regex.scan(problem)
    |&gt; Enum.reduce({0, true}, fn
      ["do()" | _], {acc, _enabled?} -&gt; {acc, true}
      ["don't()" | _], {acc, _enabled?} -&gt; {acc, false}
      [_, _, a, b], {acc, true} -&gt; {String.to_integer(a) * String.to_integer(b) + acc, true}
      [_, _, _, _], {acc, false} -&gt; {acc, false}
    end)
    |&gt; elem(0)
  end
end

</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348206" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-348206" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348206"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="348207" data-post-id="348207">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adamu" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/adamu/120/31482_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adamu
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/code-shoily" rel="nofollow">@code-shoily</a> <a class="mention" href="/u/aetherus" rel="nofollow">@Aetherus</a> makes sense, thanks! But how to prevent it while still using <code>capture: :all_but_first</code>? <img src="https://forum.elixirforum.com/images/emoji/apple/smirking_face.png?v=15" title=":smirking_face:" class="emoji" alt=":smirking_face:" loading="lazy" width="20" height="20"></p>
<p>Maybe it’s not something that’s worth worrying about <img src="https://forum.elixirforum.com/images/emoji/apple/man_shrugging.png?v=15" title=":man_shrugging:" class="emoji" alt=":man_shrugging:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348207" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-348207" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348207"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="348208" data-post-id="348208">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My todays solution was a much quicker than the other days, and I am posting this in a hurry, trying to get into the next meeting in time…</p>
<p>Though I have to speak a work of warning:</p>
<h1><a name="p-348208-warning-this-solution-is-regex-free-warning-1" class="anchor" href="#p-348208-warning-this-solution-is-regex-free-warning-1" aria-label="Heading link" rel="nofollow"></a><img src="https://forum.elixirforum.com/images/emoji/apple/warning.png?v=15" title=":warning:" class="emoji" alt=":warning:" loading="lazy" width="20" height="20"> This solution is RegEx free <img src="https://forum.elixirforum.com/images/emoji/apple/warning.png?v=15" title=":warning:" class="emoji" alt=":warning:" loading="lazy" width="20" height="20"></h1>
<p><a href="https://gitlab.com/NobbZ/aoc_ex/-/blob/main/lib/y2024/d03.ex?ref_type=heads" class="onebox" target="_blank" rel="noopener nofollow">https://gitlab.com/NobbZ/aoc_ex/-/blob/main/lib/y2024/d03.ex?ref_type=heads</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348208" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-348208" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348208"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="348209" data-post-id="348209">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="woojiahao" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/woojiahao/120/32877_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  woojiahao
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Part 2 threw me for a loop because the inputs were all separated by lines. But overall pretty fun problem</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule AOC.Y2024.Day3 do
  @moduledoc false

  use AOC.Solution

  @mul_regex ~r/mul\((\d+),(\d+)\)/
  @do_regex ~r/do\(\)/
  @dont_regex ~r/don\'t\(\)/

  @impl true
  def load_data() do
    Data.load_day(2024, 3)
    |&gt; Enum.join()
  end

  @impl true
  def part_one(data) do
    Regex.scan(@mul_regex, data, capture: :all_but_first)
    |&gt; Enum.map(fn v -&gt; Enum.map(v, &amp;String.to_integer(&amp;1)) end)
    |&gt; General.map_sum(fn [a, b] -&gt; a * b end)
  end

  @impl true
  def part_two(data) do
    data
    |&gt; get_do_instructions()
    |&gt; Enum.concat(get_dont_instructions(data))
    |&gt; Enum.concat(get_mul_instructions(data))
    |&gt; Enum.sort(fn a, b -&gt; elem(a, 0) &lt; elem(b, 0) end)
    |&gt; Enum.reduce({0, :do}, fn
      {_, :do}, {acc, _} -&gt; {acc, :do}
      {_, :dont}, {acc, _} -&gt; {acc, :dont}
      {_, :mul, a, b}, {acc, :do} -&gt; {acc + a * b, :do}
      {_, :mul, _, _}, {acc, :dont} -&gt; {acc, :dont}
    end)
    |&gt; elem(0)
  end

  defp get_mul_instructions(data),
    do:
      Regex.scan(@mul_regex, data, return: :index)
      |&gt; Enum.map(fn [{mul_idx, _}, {f, fl}, {s, sl}] -&gt;
        {mul_idx, :mul, data |&gt; String.slice(f, fl) |&gt; String.to_integer(),
         data |&gt; String.slice(s, sl) |&gt; String.to_integer()}
      end)

  defp get_do_instructions(data),
    do:
      Regex.scan(@do_regex, data, capture: :first, return: :index)
      |&gt; Enum.flat_map(&amp; &amp;1)
      |&gt; Enum.map(fn {i, _} -&gt; {i, :do} end)

  defp get_dont_instructions(data),
    do:
      Regex.scan(@dont_regex, data, capture: :first, return: :index)
      |&gt; Enum.flat_map(&amp; &amp;1)
      |&gt; Enum.map(fn {i, _} -&gt; {i, :dont} end)
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348209" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-348209" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348209"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="348210" data-post-id="348210">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Nice!</p>
<p>This made me realize that there is no case in my input where there would be a 4 digit number in the <code>mul</code> expressions.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348210" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-348210" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348210"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="348211" data-post-id="348211">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ruslandoga" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ruslandoga/120/22193_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ruslandoga
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<details><summary>No <code>Regex</code> and no <a href="https://www.erlang.org/doc/system/binaryhandling.html#match-context" rel="nofollow">sub-binaries</a></summary>
<pre data-code-wrap="elixir"><code class="lang-elixir">  defp parse_instructions("mul(" &lt;&gt; rest, acc) do
    parse_int_1(rest, 0, acc)
  end

  defp parse_instructions("do()" &lt;&gt; rest, acc) do
    parse_instructions(rest, [:do | acc])
  end

  defp parse_instructions("don't()" &lt;&gt; rest, acc) do
    parse_instructions(rest, [:dont | acc])
  end

  defp parse_instructions(&lt;&lt;_, rest::bytes&gt;&gt;, acc) do
    parse_instructions(rest, acc)
  end

  defp parse_instructions(&lt;&lt;&gt;&gt;, acc) do
    :lists.reverse(acc)
  end

  defp parse_int_1(&lt;&lt;c, rest::bytes&gt;&gt;, inner_acc, outer_acc) when c in ?0..?9 do
    parse_int_1(rest, inner_acc * 10 + c - ?0, outer_acc)
  end

  defp parse_int_1(&lt;&lt;?,, rest::bytes&gt;&gt;, inner_acc, outer_acc) do
    parse_int_2(rest, 0, [inner_acc | outer_acc])
  end

  defp parse_int_1(&lt;&lt;_, rest::bytes&gt;&gt;, _inner_acc, outer_acc) do
    parse_instructions(rest, outer_acc)
  end

  defp parse_int_2(&lt;&lt;c, rest::bytes&gt;&gt;, inner_acc, outer_acc) when c in ?0..?9 do
    parse_int_2(rest, inner_acc * 10 + c - ?0, outer_acc)
  end

  defp parse_int_2(&lt;&lt;?), rest::bytes&gt;&gt;, r, [l | outer_acc]) do
    parse_instructions(rest, [{:mul, l, r} | outer_acc])
  end

  defp parse_int_2(&lt;&lt;_, rest::bytes&gt;&gt;, _inner_acc, [_l | outer_acc]) do
    parse_instructions(rest, outer_acc)
  end
</code></pre>
<p>Full: <a href="https://github.com/ruslandoga/aoc2024/blob/master/lib/day3.ex" rel="noopener nofollow ugc">https://github.com/ruslandoga/aoc2024/blob/master/lib/day3.ex</a></p>
</details> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348211" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-348211" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348211"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="348213" data-post-id="348213">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My version would incorrectly accept 4 digit operands in the <code>mul</code> directives.</p>
<p>Specification clearly said “<code>X</code> and <code>Y</code> are each 1-3 digit numbers”.</p>
<p>I just relied on the input being not malformed in that regard <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="348213" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2024-day-3/67837/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-348213" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="348213"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/67837/load_more?page=3">Load more posts (37 remaining)</a>
</div></template></turbo-stream>