Count Good Numbers Leetcode Solutions Python