r/adventofcode • • Dec 04 '17

SOLUTION MEGATHREAD -πŸŽ„- 2017 Day 4 Solutions -πŸŽ„-

--- Day 4: High-Entropy Passphrases ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Need a hint from the Hugely* Handy† Haversack‑ of HelpfulΒ§ HintsΒ€?

Spoiler


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

18 Upvotes

319 comments sorted by

View all comments

Show parent comment

2

u/BumpitySnook Dec 04 '17

The leaderboard does feel really fast this year.

8

u/jtsimmons108 Dec 04 '17

That's because it is. Since AoC started in 2015, tonight was the fastest night to cap the leaderboard for both silver and gold.

Here are the top 7 fastest silver and gold for 100th place since AoC started

******* Part 1 100th Place Finish *******
1.  2017 - Day 04	wmorganjr - 00:01:53
2.  2017 - Day 02	msullivan - 00:02:18
3.  2017 - Day 01	jtbandes - 00:03:47
4.  2016 - Day 06	breadknock - 00:05:09
5.  2016 - Day 03	m1el - 00:05:53
6.  2015 - Day 12	Robert Offner - 00:07:36
7.  2017 - Day 03	Matt Boehm - 00:08:29

******* Part 2 100th Place Finish Times *******
1.  2017 - Day 04	Matt Gruskin - 00:03:40
2.  2017 - Day 01	Andre LeBlanc - 00:06:08
3.  2017 - Day 02	Maerig - 00:06:13
4.  2016 - Day 06	Alex Crimi - 00:06:16
5.  2015 - Day 10	Exolent - 00:12:07
6.  2016 - Day 03	(anonymous user #56115) - 00:12:07
7.  2016 - Day 15	Keegan Carruthers-Smith - 00:12:42

2

u/BumpitySnook Dec 04 '17

Neat statistics, thanks.

3

u/scarter626 Dec 04 '17

xiaowuc1 is causing me to make this face when I look at the leaderboard -> o_O

HOW is that user consistently so fast!? Both solutions for day 3 in 4:02, more than a minute faster than second place. Props to xiaowuc1 for sure!

9

u/xiaowuc1 Dec 04 '17

My strategy for AoC this year is to optimize for good average case performance. The main change I made between 2016 and 2017 is that I'm coding in Python this year instead of in Java. Despite not being nearly as comfortable with Python, it's a net improvement for me. Today highlighted my lack of familiarity with Python - I didn't immediately know how to take a string and return a string of the letters in sorted order and spent a minute figuring that out, but nonetheless it was still faster than if I had tried to code the equivalent solution in Java.

2

u/scarter626 Dec 04 '17

Congratulations on your success so far! You’re kicking butt and taking names!

I’m primarily a Java developer as well, but I agree that it would take longer to use Java for these solutions. I’ve been using ES6/ES7 level Javascript to solve the puzzles. Despite being reasonably performant with JavaScript, little things like splitting multiline inputs into an array of lines correctly slow me down since I haven’t done them with the language yet.

1

u/_jonah Dec 06 '17

xiao,

i would love to see a video of you solving one of the problems. obviously you are just super fast, but i'm curious about the details of your process.

2

u/BumpitySnook Dec 04 '17

They probably practice.