 All Problems
Nth Digit
medium
math
facebook
amazon

Given an integer n, return the nth digit of the infinite integer sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...].

Example 1:

Input: n = 3
Output: 3

Example 2:

Input: n = 11
Output: 0 (the 11th digit is in "10")

Constraints: 1 <= n <= 2^31 - 1

Run to check your code against the sample cases, or submit to run every case