Coding Ninjas Count Digits Problem