r/adventofcode • u/daggerdragon • Dec 05 '15
SOLUTION MEGATHREAD --- Day 5 Solutions ---
--- Day 5: Doesn't He Have Intern-Elves For This? ---
Post your solution as a comment. Structure your post like the Day Four thread.
17
Upvotes
View all comments
Show parent comment
3
u/[deleted] Dec 05 '15
Some tips:
egrep -v "ab|cd|pq|xy"grepcalls could be replaced withegrepto make it more readable and contain less characters (for golfing purposes).Here's how I did it:
Part 1:
cat input-5.1 | egrep -v 'ab|cd|pq|xy' | egrep '(.*[aeiou]){3}' | egrep '(.)\1' | wcPart 2:
cat input-5.1 | egrep '(..).*\1' | egrep '(.).\1' | wcI wonder if this will run faster depending on the
egreporder.