233. Number of Digit One
233. Number of Digit One
Description
Solution
We can calculate the number of one on each digit, for example
1 | To count one's number on 1234567 |
So we can have
1 | k's digit count = [n/10^(k+1)] * 10 ^ k + |
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.