Solutions to CodeJam puzzles