Numbers containing 0's from 1 to N
Submissions: 928   Accuracy:

49.21%

  Difficulty: Basic   Marks: 1

Efficiently count how many integers from 1 to N contains 0's as a digit. 

Input:
First line of the input contains the number of test cases T. Each line of test case contains the integer N.

Output:
Number of integers that contain 0 as a digit are printed.

Constraints:
1 <=T<= 100
1 <=N<= 10000

Example:
Input:

3
100
987
20

Output:
10
179
2

** For More Input/Output Examples Use 'Expected Output' option **

Author: atharv


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.