Count Good Numbers Leetcode Problems Python