My implementation of this calendar puzzle.