123456789101112131415… and on forever.
Given position, return the digit that sits at that position of the string (positions start at 1).
Building the string itself is not an option: the position can be around two billion.position=7 → 7
The first nine digits are just the numbers 1 to 9, so the seventh one is 7.
position=12 → 1
The string starts 123456789101112… Digits 10–11 form the number 10, and the 12th is the first digit of 11, which is 1.
position=190 → 1
One-digit numbers give 9 digits and two-digit numbers another 180, 189 in total. So the 190th digit is the first digit of 100.
position=7
7
Run checks the first 3 tests in your browser. Submit checks all 53 tests on the server, hidden ones included.