Problems > The Infinite Digit String > Editorial

The Infinite Digit String — Solution & Editorial

Back to the Problem

Skip whole digit-length blocks (9 one-digit numbers, 90 two-digit, ...); land inside one number and index its decimal string.

Complexity: O(log K)

Watch out: Block boundaries (positions 9, 189, 2889, ...) are exactly where off-by-ones live — test them.