Integer Replacement Leetcode Python Problems