Count commas in range II
n = 1002 -> 1,000 1,001 1,002 -> return 3class Solution: def countCommas(self, n: int) -> int: cur = n res = 0 bounds = [1_000, 1_000_000, 1_000_000_000, 1_000_000_000_000, 1_000_000_000_000_000] for i, bottom in enumerate(bounds): if cur
2026.03.15