Count Good Numbers Leetcode Problems Java