r/adventofcode • u/daggerdragon • Dec 04 '18
SOLUTION MEGATHREAD -π- 2018 Day 4 Solutions -π-
--- Day 4: Repose Record ---
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.
Advent of Code: The Party Game!
Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!
Card prompt: Day 4
Transcript:
Todayβs puzzle would have been a lot easier if my language supported ___.
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!
38
Upvotes
View all comments
Show parent comment
3
u/I-AM-PIRATE Dec 04 '18
Ahoy sebranly! Nay bad but me wasn't convinced. Give this a sail:
Argh... me just encountered a annoying issue t' be honest. me completed part 1, then coded part 2 in a few ticks o' tha clock/minutes. me ran it on thar puny example, everything be working perfectly. me decided t' run it on me input file, surprisingly me got thar same answer as part 1. But it be wrong. After 10 minutes, me figured that thar reason be because me set contained two guards that were ex-aequo (who slept thar most fer a specific minutes). N' me be checking fer thar highest score dis way:
if (count > highscore) highscore = count;
me had t' change it t' >= t' make it duty. I be a bit disappointed because dis didn't appear in thar problem statement.
Grog-filled t' share me input once me clean up me code.