Leetcode Python Practice For Loop