← ALL NOTES
Math

3870. Count Commas in Range

The number of commas in a single integer depends only on how many digits it has, so I never format a single number. I walk [1, n] band by band and multiply each band's size by its per-number comma count.

Loading…