TopCoder puzzles solved using Python