Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

When input is 201, the answer is 141. However, if you use a brute-force method to count, you will find it should be 120. Is that answer wrong?

0~99 there 20 ones;

100~199 there 100+20 ones;

200~201 there 1 one.

So the answer is 141

Thanks for your reply!

I thought it was counting the numbers containing 1 rather than how many "1"s. Thank you!

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.