Tap here to switch tabs
Problem
Submissions

Problem: Count Commas in Range

Count Commas in Range asks you to total the commas needed to write every integer from 1 through n in standard decimal notation, grouping digits in threes.

Statement

Given an integer n, return the total number of commas used when writing every integer from 11 to n inclusive in standard decimal notation with digit grouping.

In standard decimal notation, commas are placed between digits to group them in sets of three, starting from the right.

Constraints:

  • 1≤1 \le n ≤105\le 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Commas in Range

Count Commas in Range asks you to total the commas needed to write every integer from 1 through n in standard decimal notation, grouping digits in threes.

Statement

Given an integer n, return the total number of commas used when writing every integer from 11 to n inclusive in standard decimal notation with digit grouping.

In standard decimal notation, commas are placed between digits to group them in sets of three, starting from the right.

Constraints:

  • 1≤1 \le n ≤105\le 10^5