Tap here to switch tabs
Problem
Submissions

Problem: Number of Digit One

med
30 min
Try to solve the Number of Digit One problem.

Statement

Given an integer n, return the total number of times the digit 11 appears in all non negative integers less than or equal to n.

Constraints:

  • 0≤0 \leq n ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Digit One

med
30 min
Try to solve the Number of Digit One problem.

Statement

Given an integer n, return the total number of times the digit 11 appears in all non negative integers less than or equal to n.

Constraints:

  • 0≤0 \leq n ≤109\leq 10^9