Nth Digit Finder
Hard
math
digit-sequence
number-theory
optimization
Problem Description
Find the Nth digit in the infinite sequence formed by concatenating positive integers: 123456789101112131415... The sequence starts with 1 and continues indefinitely.
Input Format
A single integer N (1-indexed position).
Output Format
The Nth digit in the sequence.
Constraints
• 1 ≤ N ≤ 10^9
• Sequence: 123456789101112131415...
• 1-indexed (first digit is 1)
• Handle large N efficiently
• Don't generate entire sequence
Sample Input/Output
Input:
15
Output:
2
Explanation
Sequence: 123456789101112... Position 15 contains digit 2 (from number 12).
Solution Hints
120
Points
Points
3000ms
Time Limit
Time Limit
256MB
Memory Limit
Memory Limit
Code Editor
Register to Access Code Editor
Create a free account to solve coding problems and track your progress.
Register Now