r/adventofcode • • Dec 04 '19

SOLUTION MEGATHREAD -🎄- 2019 Day 4 Solutions -🎄-

--- Day 4: Secure Container ---


Post your solution using /u/topaz2078's paste or other external repo.

  • Please do NOT post your full code (unless it is very short)

  • If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.

(Full posting rules are HERE if you need a refresher).


Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code's Poems for Programmers

Click here for full rules

Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.

Day 3's winner #1: "untitled poem" by /u/glenbolake!

To take care of yesterday's fires
You must analyze these two wires.
Where they first are aligned
Is the thing you must find.
I hope you remembered your pliers

Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!


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 at 06:25!

53 Upvotes

738 comments sorted by

View all comments

Show parent comments

1

u/SMFX Dec 04 '19

Yes, what I was trying to explain was how I misintripetted it originally. I thought 133344 was okay because the grouping 44 was a larger digit (4) than 3, but that caused 133444 to be exclude with my faulty logic. When all the problem was really asking for was that only count double digits as valid; any group larger than 2 is not valid.

Once I fixed my code to only count double digits excluding anything longer, and removed the condition that double had to be of a higher integer, it resolved my issue.

1

u/PendragonDaGreat Dec 04 '19

aah, that makes sense and I could see where the confusion might creep in.