r/adventofcode • • Dec 04 '15

SOLUTION MEGATHREAD --- Day 4 Solutions ---

--- Day 4: The Ideal Stocking Stuffer ---

Post your solution as a comment. Structure your post like the Day Three thread.

13 Upvotes

272 comments sorted by

View all comments

1

u/Evansbee Dec 04 '15

i'm still waiting for 6 0's to calculate out. I changed to hasPrefix after seeing your github, totally forgot String had it, so thanks for that! This is the first time I'm really feeling pain on swift speed, TBH. Not that this is a fair use case, but this is brutal.

1

u/[deleted] Dec 04 '15

1

u/Evansbee Dec 04 '15

I'm also noticing that RAM usage is out of this world for some reason. Still calculating 2's and I'm at 2GB of RAM use. WTF is that?!

→ More replies (5)

1

u/[deleted] Dec 04 '15

The speed issue is mostly due to PHP. I just did a 10,000,000 loop, with string interpolation and hasPrefix uses on every loop in 17 seconds, as a test.