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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<pre data-code-wrap="elixir"><code class="lang-elixir">import AOC

aoc 2023, 4 do
  def p1(input) do
    input
    |&gt; winning_cards()
    |&gt; Enum.unzip()
    |&gt; elem(1)
    |&gt; Enum.map(fn 0 -&gt; 0; n -&gt; 2 ** (n-1) end)
    |&gt; Enum.sum()
  end

  def winning_cards(input) do
    process = fn card -&gt; card |&gt; String.split(" ", trim: true) |&gt; Enum.map(&amp;String.to_integer/1) |&gt; MapSet.new end
    input
    |&gt; String.split("\n", trim: true)
    |&gt; Enum.map(
      fn line -&gt;
        ["Card " &lt;&gt; n, cards] = String.split(line, ": ")
        card_strs = String.split(cards, "|")
        [winning, holding] = card_strs |&gt; Enum.map(process)
        {String.to_integer(String.trim(n)), MapSet.intersection(winning, holding) |&gt; Enum.count()}
      end
    )
  end

  def p2(input) do
    input
    |&gt; winning_cards()
    |&gt; Enum.map(fn {i, n} -&gt; {i, {1, n}} end)
    |&gt; process()
    |&gt; Enum.unzip()
    |&gt; elem(1)
    |&gt; Enum.unzip()
    |&gt; elem(0)
    |&gt; Enum.sum()
  end

  def process([]), do: []
  def process([{i, {0, n}} = x | xs]), do: [x | process(xs)]
  def process([{i, {count, multiplier}} = x | xs]) do
    {before, after_} = Enum.split(xs, multiplier)
    [x | process(Enum.map(before, fn {i, {c, n}} -&gt; {i, {c + count, n}} end) ++ after_)]
  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="309927" 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-2023-day-4/60132/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-309927" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309927"
                     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="309931" data-post-id="309931">
  <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>Here it is. It’s fun how we are mostly doing the same thing but nobody writes it the same.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule AdventOfCode.Y23.Day4 do
  alias AoC.Input, warn: false

  def read_file(file, _part) do
    Input.stream!(file, trim: true)
  end

  def parse_input(input, _part) do
    input
    |&gt; Enum.map(fn "Card " &lt;&gt; rest -&gt;
      rest = String.trim_leading(rest)
      {card_id, ": " &lt;&gt; rest} = Integer.parse(rest)
      [winnings, playings] = String.split(rest, " | ")
      winnings = list_of_ints(winnings)
      playings = list_of_ints(playings)
      {card_id, winnings, playings}
    end)
  end

  defp list_of_ints(str) do
    str |&gt; String.split(" ", trim: true) |&gt; Enum.map(&amp;String.to_integer/1)
  end

  def part_one(problem) do
    problem
    |&gt; Enum.map(fn {_, winnings, playings} -&gt;
      wins = MapSet.new(winnings)
      plays = MapSet.new(playings)
      pow = MapSet.size(MapSet.intersection(wins, plays))
      trunc(:math.pow(2, pow - 1))
    end)
    |&gt; Enum.sum()
  end

  def part_two(problem) do
    problem
    |&gt; Enum.map_reduce(%{}, fn {card_id, winnings, playings}, acc -&gt;
      n_cards = 1 + Map.get(acc, card_id, 0)
      wins = MapSet.new(winnings)
      plays = MapSet.new(playings)

      acc =
        case MapSet.size(MapSet.intersection(wins, plays)) do
          0 -&gt;
            acc

          n_wins -&gt;
            adds = (card_id + 1)..(card_id + n_wins)

            Enum.reduce(adds, acc, fn next_card_id, acc -&gt;
              Map.update(acc, next_card_id, n_cards, &amp;(&amp;1 + n_cards))
            end)
        end

      {n_cards, acc}
    end)
    |&gt; elem(0)
    |&gt; Enum.sum()
  end
end

</code></pre>
<p><a class="mention" href="/u/aetherus" rel="nofollow">@Aetherus</a> I just read your post and indeed there is no need to parse as integers. But with my code it is actually faster when I pay the cost to do it. Probably because it speeds up the matching in <code>Map.get</code>…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="309931" 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-2023-day-4/60132/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-309931" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309931"
                     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="309937" data-post-id="309937">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My solution :</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Scratchcards do
  import NimbleParsec

  defparsec(
    :parse_line,
  
    ignore(string("Card") |&gt; repeat(ignore(string(" "))))
    |&gt; integer(min: 1, max: 3)
    |&gt; ignore(string(":"))
    |&gt; ignore(repeat(ignore(string(" "))))
    |&gt; tag(repeat(integer(min: 1, max: 2) |&gt; repeat(ignore(string(" ")))), "numbers")
    |&gt; ignore(string("|"))
    |&gt; repeat(ignore(string(" ")))
    |&gt; tag(repeat(integer(min: 1, max: 2) |&gt; repeat(ignore(string(" ")))), "winning")
  )
  defp points(0), do: 0

  defp points(x), do: 2 ** (x - 1)


  defp calculate_score(line) do
    {:ok, [_, {"numbers", numbers}, {"winning", winning}], _, _, _, _} = parse_line(line) 
    MapSet.intersection(MapSet.new(numbers), MapSet.new(winning))
    |&gt; MapSet.to_list()
    |&gt; length()
  end

  def part1(input) do
    input
    |&gt; String.split("\n")
    |&gt; Enum.map(fn line -&gt;
      line
      |&gt; calculate_score()
      |&gt; points()
    end)
    |&gt; Enum.sum()
  end

  defp count(input, pos, total) do
    
    score = Enum.at(input, pos)
    if score &gt; 0 do
      Enum.reduce((pos + 1)..(pos + score), total, fn(i, total) -&gt; 
        count(input, i, total + 1)
      end)
    else
      total
    end
  end

  def part2(input) do
    scores = input
    |&gt; String.split("\n")
    |&gt; Enum.map(fn line -&gt;
      calculate_score(line)
    end)
    
    scores
    |&gt; Enum.with_index()
    |&gt; Enum.reduce(0, fn({_v, i}, total) -&gt;
       total + count(scores, i, 1)
    end)
  end
end

Scratchcards.part2(input)
</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="309937" 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-2023-day-4/60132/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-309937" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309937"
                     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="309938" data-post-id="309938">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<h2><a name="p-309938-parsing-1" class="anchor" href="#p-309938-parsing-1" aria-label="Heading link" rel="nofollow"></a>Parsing</h2>
<pre data-code-wrap="elixir"><code class="lang-elixir">cards =
  puzzle_input
  |&gt; String.split("\n", trim: true)
  |&gt; Enum.map(fn "Card" &lt;&gt; rest -&gt;
    {id, ": " &lt;&gt; rest} = rest |&gt; String.trim() |&gt; Integer.parse()

    [wins, inputs] =
      rest
      |&gt; String.split(" | ")
      |&gt; Enum.map(fn part -&gt;
        part
        |&gt; String.split()
        |&gt; Enum.map(&amp;String.to_integer/1)
      end)

    {id, wins, inputs}
  end)
</code></pre>
<h2><a name="p-309938-part-1-2" class="anchor" href="#p-309938-part-1-2" aria-label="Heading link" rel="nofollow"></a>Part 1</h2>
<pre data-code-wrap="elixir"><code class="lang-elixir">cards
|&gt; Enum.map(fn {_, wins, inputs} -&gt;
  matches = length(wins) - length(wins -- inputs)

  if matches &gt; 0, do: 2**(matches - 1), else: 0
end)
|&gt; dbg()
|&gt; Enum.sum()
</code></pre>
<h2><a name="p-309938-part-2-3" class="anchor" href="#p-309938-part-2-3" aria-label="Heading link" rel="nofollow"></a>Part 2</h2>
<pre data-code-wrap="elixir"><code class="lang-elixir">cards
|&gt; Enum.reduce(%{}, fn {id, wins, inputs}, acc -&gt;
  matches = length(wins) - length(wins -- inputs)
  {current, acc} = Map.get_and_update(acc, id, fn v -&gt;
    v = (v || 0) + 1
    {v, v}
  end)

  Enum.reduce(1..matches//1, acc, &amp;Map.update(&amp;2, id + &amp;1, current, fn a -&gt; a + current end))
end)
|&gt; Map.values()
|&gt; Enum.sum()
</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="309938" 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-2023-day-4/60132/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-309938" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309938"
                     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="309939" data-post-id="309939">
  <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>Learned <code>Map.get_and_update</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="309939" 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-2023-day-4/60132/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-309939" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309939"
                     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="309968" data-post-id="309968">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="trnasistor" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  trnasistor
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My beginner’s solution, Day 4.<br>
I had a lot of fun implementing a function using <code>[tail | head]</code> syntax. Is it idiomatic?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Day04 do

  def part2(input) do
   input
    |&gt; String.split("\n")
    |&gt; Enum.map(&amp;parse_to_map_of_your_and_winning_numbers/1)
    |&gt; Enum.map(&amp;amount_of_winning_numbers/1)  
    |&gt; Enum.reverse
    # [0, 0, 1, 2, 2, 4]
    |&gt; total_scratchcards
  end
  
  def part1(input) do
    input
    |&gt; String.split("\n")
    |&gt; Enum.map(&amp;parse_to_map_of_your_and_winning_numbers/1)
    |&gt; Enum.map(&amp;amount_of_winning_numbers/1)
    |&gt; Enum.map(&amp;calculate_worth/1)
    |&gt; Enum.sum
  end 

  def parse_to_map_of_your_and_winning_numbers(line) do
    # "Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53"
    line
    |&gt; String.split(": ")
    |&gt; List.last
    |&gt; String.split(" | ")
    |&gt; Enum.map(fn x -&gt; x
                |&gt; String.split
                |&gt; Enum.map(&amp;String.to_integer/1)
                end)
    |&gt; then(fn [w, y] -&gt; %{your: y, winning: w} end)
    # %{ winning: [41, 48, 83, 86, 17], 
    #       your: [83, 86, 6, 31, 17, 9, 48, 53] }    
  end

  def amount_of_winning_numbers(card) do
    # %{ winning: [41, 48, 83, 86, 17], 
    #       your: [83, 86, 6, 31, 17, 9, 48, 53] }    
    for your_number &lt;- card.your do
      Enum.member?(card.winning, your_number)
    end
    |&gt; Enum.count(&amp;(&amp;1))
  end

  def calculate_worth(0), do: 0
  def calculate_worth(n), do: :math.pow(2, n-1) |&gt; round

  def total_scratchcards(how_many_wins_list, scratchcards_amount_list \\ [])
  def total_scratchcards([], amount_list), do: Enum.sum(amount_list)
  def total_scratchcards([head | tail], amount_list) do
    amount = amount_list
      |&gt; Enum.take(head)
      |&gt; Enum.sum
      |&gt; Kernel.+(1)
    
    total_scratchcards(tail, [amount] ++  amount_list)
  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="309968" 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-2023-day-4/60132/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-309968" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309968"
                     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="309980" data-post-id="309980">
  <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>I was proud of my recursive copy function, until I saw <a class="mention" href="/u/bjorng" rel="nofollow">@bjorng</a>’s <img src="https://forum.elixirforum.com/images/emoji/apple/flushed_face.png?v=15" title=":flushed_face:" class="emoji" alt=":flushed_face:" loading="lazy" width="20" height="20"></p>
<p>edit: tidied up enough to share. Both parts under a ms.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def part1(input) do
    input
    |&gt; Enum.map(fn 0 -&gt; 0; num_winners -&gt; 2 ** (num_winners - 1) end)
    |&gt; Enum.sum()
  end

  def part2(input) do
    input
    |&gt; Enum.map(fn num_winners -&gt; {_num_copies = 1, num_winners} end)
    |&gt; copy()
    |&gt; Enum.sum()
  end

  def copy([]), do: []

  def copy([{num_copies, num_winners} | rest]) do
    {to_copy, left_alone} = Enum.split(rest, num_winners)

    copied =
      Enum.map(to_copy, fn {child_num_copies, num_winners} -&gt;
        {num_copies + child_num_copies, num_winners}
      end)

    [num_copies | copy(copied ++ left_alone)]
  end
</code></pre>
<p><a href="https://git.adamu.jp/adam/AdventOfCode/src/branch/main/2023/day4.exs" class="onebox" target="_blank" rel="noopener nofollow ugc">https://git.adamu.jp/adam/AdventOfCode/src/branch/main/2023/day4.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="309980" 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-2023-day-4/60132/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-309980" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="309980"
                     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="310003" data-post-id="310003">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Solved part 2 with a single <code>for reduce</code>:</p>
<p><a href="https://github.com/pehbehbeh/adventofcode/blob/main/2023/04.livemd" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/pehbehbeh/adventofcode/blob/main/2023/04.livemd</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="310003" 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-2023-day-4/60132/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-310003" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310003"
                     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="310056" data-post-id="310056">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For me it was the easier this year. quite fun to solve.</p>
<p><a href="https://github.com/pedrosnk/coffee_and_kata/blob/main/aoc_2023/day_04/lib/day04.ex" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/pedrosnk/coffee_and_kata/blob/main/aoc_2023/day_04/lib/day04.ex</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="310056" 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-2023-day-4/60132/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-310056" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310056"
                     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="310085" data-post-id="310085">
  <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
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here is mine, I fell asleep last night, and solved it quite quickly, this should have been day 1 lol.</p>
<p><a href="https://github.com/code-shoily/advent_of_code/blob/master/lib/2023/day_04.ex" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/code-shoily/advent_of_code/blob/master/lib/2023/day_04.ex</a></p>
<p>Thank you <a class="mention" href="/u/christophebelpaire" rel="nofollow">@ChristopheBelpaire</a> I am trying to grok parser combinators and your code cleared some concepts for me.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310085" 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-2023-day-4/60132/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-310085" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310085"
                     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/60132/load_more?page=3">Load more posts (5 remaining)</a>
</div></template></turbo-stream>