Advent of Code: Day 5
Doesn't He Have Intern-Elves For This?

First puzzle

In this puzzle, we need to count how many words in the input has the following properties:

Some examples are shown in the puzzle description:

First let us parse the input string into words:

We can express these three rules as functional and combine them. The resulting function can be applied to the parsed input, and the length of that array is the answer:

Second puzzle

The second puzzle is the same as the first one, but the properties changed:

Here are some examples:

The key for the first property is to substitute the current two letters when looking for them on the rest of the word:

You can find this code along with my input and puzzle answers at here.

Written by Darien Martinez Torres on 05 March 2016