Consider writing all positive integers continuously without any spaces:
This forms an infinite sequence of digits.
You are given an integer n, and you need to return the digit that appears at the n-th position (1-based) in this sequence.
Input: n = 5
Output: 5
Explanation:
Sequence: "12345...", the 5th digit is 5.
Input: n = 12
Output: 1
Explanation:
Sequence: "1234567891011..." The 12th digit lies in the number "10", specifically the '1'.
Accepted:
Submission: