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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I haven’t been spoiled until now … but I didn’t find the solution either <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/3/6/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7.png" data-download-href="https://forum.elixirforum.com/uploads/default/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7" title="CleanShot 2019-12-12 at 15.28.04@2x" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/3/6/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7_2_690x67.png" alt="CleanShot 2019-12-12 at 15.28.04@2x" data-base62-sha1="7J9pfpIRieeHD8e6LecMH6Pe1sH" width="690" height="67" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/3/6/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7_2_690x67.png, https://forum.elixirforum.com/uploads/default/optimized/3X/3/6/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7_2_1035x100.png 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/3/6/3629d4e505d8890ef7bb5aac2fbbe1d2fa4360b7_2_1380x134.png 2x" data-dominant-color="F0EAEA"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">CleanShot 2019-12-12 at 15.28.04@2x</span><span class="informations">1564×152 18.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="154551" 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-2019-day-12/27527/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-154551" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="154551"
                     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="154565" data-post-id="154565">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ferd" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ferd/120/12731_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ferd
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Property-Based Testing with PropEr, LYSE, &amp; Erlang in Anger</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<div class="youtube-onebox lazy-video-container" data-video-id="EvTEh358Vt4" data-video-title="Advent of Code 2019 - Day 12" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=EvTEh358Vt4" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://i.ytimg.com/vi/EvTEh358Vt4/hqdefault.jpg" title="Advent of Code 2019 - Day 12" width="480" height="360">
  </a>
</div>
<p>
Part 2 was clearly one of the most intimidating problems to me this year. They dressed it up in fancy clothes with a big name and I imagined it to be worst than it was.</p>
<p>Source at <a href="https://gist.github.com/ferd/0301e44a7068a067ac4b5434027026e5" class="inline-onebox" rel="noopener nofollow ugc">day12.erl · GitHub</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="154565" 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-2019-day-12/27527/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-154565" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="154565"
                     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="154573" data-post-id="154573">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>After some failed attempts, I realized that it requires seeing the problem in a different view point. Brute force would not work anymore. I didn’t find the solution immediately. It was frustrating but I let it go.</p>
<p>When I had time this evening, I read the data carefully once again, and thought, maybe I can try separating their positions and velocities of 3D into three groups of 1D data, that would significantly lower the pressure.</p>
<p>So I took it a try and fortunately it worked!</p>
<p><a href="https://github.com/qhwa/AdventOfCode/blob/master/lib/aoc/2019/day12.ex" rel="noopener nofollow ugc">Here’s the solution</a> I end up with. I’m so glad I learned this new pattern. <img src="https://forum.elixirforum.com/images/emoji/apple/grinning.png?v=15" title=":grinning:" class="emoji" alt=":grinning:" loading="lazy" width="20" height="20"></p>
<p>BTW. It finished part 2 in 580ms on my laptop. Not bad.</p> 
	            </div>

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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had to get a hint about looking at each component of position/vector independently. Then it was relatively easy.</p>
<p><a href="https://github.com/mortalisk/aoc2019/blob/master/lib/day12.ex" rel="noopener nofollow ugc">My solution</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="154612" 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-2019-day-12/27527/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-154612" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="154612"
                     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="154673" data-post-id="154673">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><img src="https://forum.elixirforum.com/images/emoji/apple/fire.png?v=15" title=":fire:" class="emoji" alt=":fire:" loading="lazy" width="20" height="20"> <img src="https://forum.elixirforum.com/images/emoji/apple/fire.png?v=15" title=":fire:" class="emoji" alt=":fire:" loading="lazy" width="20" height="20"> I did it !!! <img src="https://forum.elixirforum.com/images/emoji/apple/fire.png?v=15" title=":fire:" class="emoji" alt=":fire:" loading="lazy" width="20" height="20"> <img src="https://forum.elixirforum.com/images/emoji/apple/fire.png?v=15" title=":fire:" class="emoji" alt=":fire:" loading="lazy" width="20" height="20"></p>
<p>I’m proud to have figured out the <em>one axis + LCM</em> trick by myself (even if it involved not sleeping anymore after 5AM, damn brain … <img src="https://forum.elixirforum.com/images/emoji/apple/exploding_head.png?v=15" title=":exploding_head:" class="emoji" alt=":exploding_head:" loading="lazy" width="20" height="20">)</p>
<p>I had initially part2 solved in 6 seconds. Running each axis in parallel tasks allowed me to get result in 3 seconds. Then after reading <a class="mention" href="/u/qhwa" rel="nofollow">@qhwa</a> code (good job btw <img src="https://forum.elixirforum.com/images/emoji/apple/+1.png?v=15" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20">), I simplified my data structure and switched from a map of structs to an array of tuples.</p>
<p>Part2 is now running in 800ms <img src="https://forum.elixirforum.com/images/emoji/apple/sunglasses.png?v=15" title=":sunglasses:" class="emoji" alt=":sunglasses:" loading="lazy" width="20" height="20">, my code: <a href="https://github.com/cblavier/advent/tree/master/lib/2019/day12" class="inline-onebox" rel="noopener nofollow ugc">advent/lib/2019/day12 at master · cblavier/advent · GitHub</a></p>
<p>I’m one day late now … <img src="https://forum.elixirforum.com/images/emoji/apple/expressionless.png?v=15" title=":expressionless:" class="emoji" alt=":expressionless:" 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="154673" 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-2019-day-12/27527/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-154673" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="154673"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>