Part 1: A ’nice’ string contains at least three vowels, one double letter (such as xx
), and none of the strings ab
, cd
, pq
, or xy
. Count nice strings.
Part 1: A ’nice’ string contains at least three vowels, one double letter (such as xx
), and none of the strings ab
, cd
, pq
, or xy
. Count nice strings.
Part 1: Mine Adventcoins. Basically, find the lowest integer such that the string {prefix}{integer}
has an md5 hash with at least 5 leading zeros. 123
Part 1: Given a string of <>^v
characters which mean move west, east, north, or south respectively and starting at the origin, how many unique positions do you pass through?
Part 1: A gift requires enough wrapping paper to cover the surface plus an additional amount equal to the area smallest side. Calculate the total wrapping paper needed for a list of dimensions of the form 2x3x4
.
To counter yesterday’s post on Iterating the GitHub API, how about something a little more lighthearted today: GIFs1.
Part 1: Given a string of ()
characters controlling a simulated elevator, where (
means ‘go up’ and )
means ‘go down’, what floor do you end up on?
I’m always on the lookout for new sources of quick1 coding puzzles. This holiday season, Advent of Code scratches precisely that itch.
Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme. – About - Advent of Code
I’ve been working out each problem thus far in Python (my language of choice; along with Racket). I’m backfilling the first seven posts (along with this one), but I’ll try to do the rest daily.
Today I found myself auditing an organization’s users to see which have multifactor authentication enabled1. Since we have a not insignificant number of users, I wanted to write a quick script to automate it. Down the rabbit hole I go… and now I have a clean way of iterating across paginated GitHub API responses.
Another script similar to my previous post about Finding AWS IAM users by access key. This time, we want to do much the same thing for EC2 instances by tag.
Based on a /r/dailyprogrammer puzzle: Takuzu solver.
Basically, Takuzu is a logic puzzle similar to Sudoku. You are given a grid partially filled with 0s and 1s. You have to fill in the rest of the grid according to three simple rules:
Thus, if you have a puzzle like this:
0.01.1
0....1
..00..
..00..
1....0
10.0.0
One valid solution (most puzzles should have only a single valid answer, but that doesn’t always seem to be the case):
010101
001101
110010
010011
101100
101010
Let’s do it!