Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

pagesNumbering C++

int pagesNumbering(int n)
{
    int number_of_digits = 0;
    for(int i = 1; i <= n; i *= 10)
        number_of_digits += (n - i + 1);
    return number_of_digits;
} // => tiến code
Source by leetcode.com #
 
PREVIOUS NEXT
Tagged: #pagesNumbering
ADD COMMENT
Topic
Name
4+1 =