Tap here to switch tabs
Problem
Submissions

Problem: Count Commas in Range II

Count Commas in Range II asks you to return the total commas used when every integer from one through a given positive number is written with standard three-digit grouping.

Statement

Given a positive integer n, return the total number of commas used when writing all integers from 11 to n inclusive in standard formatting, where a comma separates every group of 33 digits starting from the right.

Constraints:

  • 1≤1 \leq n ≤1015\leq 10^{15}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Commas in Range II

Count Commas in Range II asks you to return the total commas used when every integer from one through a given positive number is written with standard three-digit grouping.

Statement

Given a positive integer n, return the total number of commas used when writing all integers from 11 to n inclusive in standard formatting, where a comma separates every group of 33 digits starting from the right.

Constraints:

  • 1≤1 \leq n ≤1015\leq 10^{15}