Count numbers having 0 as a digit
Problem: Count how many integers from 1 to N contains 0 as a digit.Examples: Input: n = 9Output: 0Input: n = 107Output: 17The numbers having 0 are 10, 20,..90, 100, 101..107Input: n = 155Output: 24The numbers having 0 are 10, 20,..90, 100, 101..110,120, ..150.A naive solution is discussed in previou