Problems
Scratchpad
Run
Submit
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
:
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
Toggle theme (Current: Custom)
Scratchpad
Run
Submit
Description
Hints
Solutions
233. Number of Digit One
Hard
50 Points
Math
Dynamic Programming
Recursion
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
Examples
Example 1
Input: n = 13 Output: 6
Example 2
Input: n = 0 Output: 0
Constraints
0 <= n <= 109
JAVASCRIPT
Code
Tests
Result
Description
Hints
Solutions
233. Number of Digit One
Hard
50 Points
Math
Dynamic Programming
Recursion
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
Examples
Example 1
Input: n = 13 Output: 6
Example 2
Input: n = 0 Output: 0
Constraints
0 <= n <= 109
JAVASCRIPT
Code
Tests
Result
Number of Digit One - Practice Coding | SlaveCode