Count Good Numbers Leetcode Solution Python