Back and forth programming puzzles