solutions to programming puzzles