Count Good Numbers Leetcode Python