Count total number of digits from 1 to n.
- n=13
- output=17
since from [1-9] total 9 digits.[10-13] total 4*2=8 digits.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers30
Suggested Problems
-
421 Solvers
-
Test if a Number is a Palindrome without using any String Operations
252 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
554 Solvers
-
Vectorize the digits of an Integer
337 Solvers
-
150 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
In the 5th test case there is number n=10000675820025; which is very large number MATLAB is not accepting to get number from 1 to 10000675820025;
@Bhaskar
that means u need to find some alternate way to solve