306.Consecutive Ones
★★★combinatoricsIMC Trading
How many integers from 0 to 99,999 inclusive contain two consecutive 1s somewhere in their five-digit representation (padding with leading zeros)?
Sign in to submit an answer and track it toward your stats.
Sign inHint
Count the strings that avoid '11' with a recursion, then subtract from the total. The recursion is Fibonacci-flavoured but each position has ten choices, not two.
Want timed drills, mental math, and a market-making game too? Try the full practice suite →