271.Counting the Digit Two
★★★combinatoricsJane Street
Across all the integers from 1 to 1,000,000 inclusive, how many times does the digit 2 appear in total?
Sign in to submit an answer and track it toward your stats.
Sign inHint
Pad every number to a fixed width with leading zeros. Then each digit position behaves identically and independently.
Want timed drills, mental math, and a market-making game too? Try the full practice suite →