Concatenating Numbers 1
InterviewTime limit0.15sMemory limit128 MB
Compute the total digit count when integers from 1 to N are written consecutively without spaces.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Write the integers from 1 through N in order without spaces. This creates one long number.
1234567891011121314151617181920212223...
Write a program that determines how many digits this number has.
Input
The first line contains an integer N. (1 <= N <= 100,000,000)
Output
Print the number of digits in the constructed number.