Count Good Numbers Leetcode Problems Javascript