Skip to content

Practice Nth Digit

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#400
LeetCode Problem

Nth Digit

Problem Statement

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

Source: Nth Digit on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 3
Output
3

# Example 2

Input
n = 11
Output
0

Constraints

1 <= n <= 2^31 - 1

Related LeetCode Problems

Practice more problems similar to Nth Digit.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.