Skip to content

Commit 2e35911

Browse files
authored
Update 400. Nth Digit.java
1 parent f81c272 commit 2e35911

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

400. Nth Digit.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public int findNthDigit(int n) {
3232
}
3333

3434
// Space and Time improvement https://discuss.leetcode.com/topic/59378/short-python-java
35+
// Rather than iterate single number, move up in range 1-9, 10-99, 100-999, 1000-999
36+
// First number in range + Left over (n*) / digits = Actual number
3537
public int findNthDigit(int n) {
3638
n -= 1;
3739
int digits = 1, first = 1;

0 commit comments

Comments
 (0)