Python Questions On Leetcode 150 Problem