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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Alright guys, couldn’t resist and optimised my solution with the binary trick.</p>
<p>I think nobody yet used <code>Integer.undigits/2</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def get_seat_id(seat) do
  seat
  |&gt; String.graphemes()
  |&gt; Enum.map(fn char -&gt; if char in ["F", "R"], do: 1, else: 0 end)
  |&gt; Integer.undigits(2)
end
</code></pre>
<p><a href="https://github.com/egze/aoc/blob/master/lib/aoc/y2020/d5.ex" rel="noopener nofollow ugc">Full code</a></p>
<p><strong>EDIT:</strong> hmm, it’s actually not working correctly. Will fix later <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="196491" 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-2020-day-5/35997/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-196491" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196491"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="196492" data-post-id="196492">
  <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>This is great. I’m a bit disappointed in myself that I didn’t work it out. All that halving, <code>128</code>, <code>8</code>, <strong>multiplying by <code>8</code></strong>, the encoding being called <em>binary space partitioning</em>. I was like “this sure feels like binary” - it didn’t occur to me though that the 3-bit column was just bitshifted and the whole thing could be parsed directly to an integer. <img src="https://forum.elixirforum.com/images/emoji/apple/man_facepalming/3.png?v=15" title=":man_facepalming:t3:" class="emoji" alt=":man_facepalming:t3:" loading="lazy" width="20" height="20"></p>
<p>Instead I diligently parsed it according to the “rules”:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    row =
      Enum.reduce(row_spec, {0, 128}, fn
        ?F, {front, 2} -&gt; front
        ?B, {front, 2} -&gt; front + 1
        ?F, {front, count} -&gt; {front, div(count, 2)}
        ?B, {front, count} -&gt; {front + div(count, 2), div(count, 2)}
      end)
</code></pre>
<p>And for part 2, I zipped the list of IDs with itself shifted by 1, to find the first non-sequential ID:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def find_seat([_ | next_seats] = seats) do
    Stream.zip(seats, next_seats)
    |&gt; Enum.find(fn {seat, next} -&gt; next - seat &gt; 1 end)
    |&gt; elem(0)
    |&gt; Kernel.+(1)
  end
</code></pre>
<p>Full solution on Github</p>
<p><a href="https://github.com/adamu/AdventOfCode2020/tree/main/day5" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/adamu/AdventOfCode2020/tree/main/day5</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="196492" 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-2020-day-5/35997/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-196492" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196492"
                     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 #23"></div>
  </section>
</div>
    <div class="postbit" id="196493" data-post-id="196493">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I also didn’t figure out the trick but still happy with my solution. Nothing fancy just pattern matching and recursion</p>
<p><a href="https://github.com/bodgix/aoc2020/blob/main/day5.exs" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/bodgix/aoc2020/blob/main/day5.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="196493" 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-2020-day-5/35997/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-196493" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196493"
                     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 #24"></div>
  </section>
</div>
    <div class="postbit" id="196499" data-post-id="196499">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, that bitshift by the same number of places as the column storage in retrospect is an obvious thing.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Day5 do
  @input File.stream!("lib/input.txt")

  @process_input @input
                 |&gt; Stream.map(&amp;String.trim(&amp;1))
                 |&gt; Stream.map(
                   &amp;String.replace(&amp;1, ["F", "B", "L", "R"], fn c -&gt;
                     case c do
                       "F" -&gt; "0"
                       "B" -&gt; "1"
                       "L" -&gt; "0"
                       "R" -&gt; "1"
                     end
                   end)
                 )
                 |&gt; Stream.map(&amp;String.split_at(&amp;1, 7))
                 |&gt; Stream.map(fn {a, b} -&gt; {Integer.parse(a, 2), Integer.parse(b, 2)} end)
                 |&gt; Enum.map(fn {{a, _}, {b, _}} -&gt; a * 8 + b end)

  def highest_seat do
    @process_input
    |&gt; Enum.max()
  end

  def sort_tickets do
    @process_input
    |&gt; Enum.sort()
  end

  def find_gap do
    sort_tickets()
    |&gt; Stream.chunk_every(2, 1, :discard)
    |&gt; Stream.filter(fn [a, b] -&gt; b - a != 1 end)
    |&gt; Enum.reduce(1, fn [a, _], acc -&gt; acc + a end)
  end
end

IO.inspect(Day5.highest_seat())
IO.inspect(Day5.find_gap())

</code></pre>
<p>I can see where <code>find</code> is more efficient than my <code>filter</code> approach since it would be short-circuiting.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="196499" 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-2020-day-5/35997/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-196499" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196499"
                     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 #25"></div>
  </section>
</div>
    <div class="postbit" id="196500" data-post-id="196500">
  <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>How about this for the binary parsing <a class="mention" href="/u/aetherus" rel="nofollow">@Aetherus</a>, <a class="mention" href="/u/aaronnamba" rel="nofollow">@aaronnamba</a> <a class="mention" href="/u/egze" rel="nofollow">@egze</a> (looks like <a class="mention" href="/u/lud" rel="nofollow">@lud</a> was almost there too)?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def char_to_bit(c) when c in 'FL', do: &lt;&lt;0::1&gt;&gt;
def char_to_bit(c) when c in 'BR', do: &lt;&lt;1::1&gt;&gt;

def seat_id(boarding_pass \\ "FBFBBFFRLR") do
  &lt;&lt;id::integer-10&gt;&gt; = for &lt;&lt;char &lt;- boarding_pass&gt;&gt;, into: &lt;&lt;&gt;&gt;, do: char_to_bit(char)
  id
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="196500" data-batch-url="/posts/batch_likers">
                        8
                      </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-2020-day-5/35997/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-196500" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196500"
                     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 #26"></div>
  </section>
</div>
    <div class="postbit" id="196509" data-post-id="196509">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="JEG2" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/JEG2/120/936_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  JEG2
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Designing Elixir Systems with OTP</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Really enjoying the puzzles so far this year.  Here’s my Day 5:</p>
<p><a href="https://github.com/JEG2/advent_of_code_2020/blob/main/day_05/boarding.exs" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/JEG2/advent_of_code_2020/blob/main/day_05/boarding.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="196509" 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-2020-day-5/35997/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-196509" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196509"
                     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 #27"></div>
  </section>
</div>
    <div class="postbit" id="196512" data-post-id="196512">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The bit manipulation solution is awesome, definitely the most efficient - O(n)</p>
<p>I get a O(n log m) solution</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Advent.Day5 do

  @rows 0..128 |&gt; Enum.map(fn o -&gt; o end)
  @cols [0,1,2,3,4,5,6,7]

  def start(part, file \\ "/tmp/input.txt")
  def start(:part1, file), do:
    File.stream!(flie)
    |&gt; Enum.reduce(0, fn o, acc -&gt; max(acc, find_seat_id(to_charlist(o), @rows, @cols)) end)

  def start(:part2, file), do:
    File.stream!(file)
    |&gt; Enum.map(fn o -&gt; find_seat_id(to_charlist(o), @rows, @cols) end)
    |&gt; Enum.sort()
    |&gt; Enum.reduce_while(-1, fn o, acc -&gt;
        cond do
          acc == -1 -&gt; {:cont, o}
          o - acc == 1 -&gt; {:cont, o}
          true -&gt; {:halt, o - 1}
        end
      end)

  def find_seat_id(_, [rows], [cols]), do: rows * 8 + cols

  def find_seat_id([v|t], rows, cols) when v in [?F,?B], do:
    find_seat_id(t, split_half(rows) |&gt; elem(v == ?F &amp;&amp; 0 || 1), cols)

  def find_seat_id([v|t], rows, cols), do:
    find_seat_id(t, rows, split_half(cols) |&gt; elem(v == ?L &amp;&amp; 0 || 1))

  defp split_half(lst), do: Enum.split(lst, div(length(lst), 2))

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="196512" 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-2020-day-5/35997/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-196512" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196512"
                     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 #28"></div>
  </section>
</div>
    <div class="postbit" id="196516" data-post-id="196516">
  <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
                    <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>Great trick! 1-bit binary!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="196516" 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-2020-day-5/35997/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-196516" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196516"
                     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 #29"></div>
  </section>
</div>
    <div class="postbit" id="196520" data-post-id="196520">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I was inspired by <a class="mention" href="/u/akagrawal" rel="nofollow">@akagrawal</a>’s solution to find the missing id by taking advantage of the input ids being a sequence. I was curious if there was a way to do so still using just <code>Bitwise</code> operators. Turns out there is! Credit to the source <a href="https://www.geeksforgeeks.org/find-the-missing-number/" class="inline-onebox" rel="noopener nofollow ugc">Find the Missing Number - GeeksforGeeks</a><br>
We can determine the missing value if we XOR the XOR of the entire sequence with the XOR of all the given values, i.e. where <code>a_m</code> is the missing value</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">full = a_min ^ ... ^ a_m ^ ... ^ a_max
sub = a_min ^ ... ^ a_m-1 ^ a_m+1 ^ ... ^ a_max
a_m = sub ^ full
</code></pre>
<p>Here’s my updated solution, just for fun</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Advent.Y2020.D05 do
  use Bitwise, only_operators: true

  @spec part_one(passes :: Enumerable.t(String.t())) :: integer
  def part_one(passes) do
    passes
    |&gt; Stream.map(&amp;seat_id/1)
    |&gt; Enum.max()
  end

  # NOTE: this strategy assumes there is exactly one missing id within a
  # contiguous set of ids (and ids are all positive)
  @spec part_two(passes :: Enumerable.t(String.t())) :: integer
  def part_two(passes) do
    passes
    |&gt; Stream.map(&amp;seat_id/1)
    |&gt; Enum.reduce({:infinity, -1, 0}, fn id, {min, max, sum} -&gt;
      min = if id &lt; min, do: id, else: min
      max = if id &gt; max, do: id, else: max
      sum = sum ^^^ id

      {min, max, sum}
    end)
    |&gt; (fn {min, max, sum} -&gt;
          sum ^^^ Enum.reduce(min..max, 0, &amp;(&amp;1 ^^^ &amp;2))
        end).()
  end

  defp seat_id(partition) do
    partition
    |&gt; String.graphemes()
    |&gt; Enum.reduce(0, fn c, sum -&gt;
      sum = sum &lt;&lt;&lt; 1
      if c == "B" || c == "R", do: sum ||| 1, else: sum
    end)
  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="196520" 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-2020-day-5/35997/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-196520" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196520"
                     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 #30"></div>
  </section>
</div>
    <div class="postbit" id="196543" data-post-id="196543">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just mixed up the character for 1.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def get_seat_id(seat) do
  seat
  |&gt; String.graphemes()
  |&gt; Enum.map(fn char -&gt; if char in ["B", "R"], do: 1, else: 0 end)
  |&gt; Integer.undigits(2)
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="196543" 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-2020-day-5/35997/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-196543" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="196543"
                     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 #31"></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/35997/load_more?page=4">Load more posts (2 remaining)</a>
</div></template></turbo-stream>