Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0205948

Browse files
refaactor 400
1 parent 58f1227 commit 0205948

File tree

1 file changed

+1
-24
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-24
lines changed

src/main/java/com/fishercoder/solutions/_400.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 400. Nth Digit
5-
*
6-
* Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
7-
8-
Note:
9-
n is positive and will fit within the range of a 32-bit signed integer (n < 231).
10-
11-
Example 1:
12-
Input:
13-
3
14-
Output:
15-
3
16-
17-
Example 2:
18-
Input:
19-
11
20-
Output:
21-
0
22-
23-
Explanation:
24-
The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.
25-
*/
263
public class _400 {
274

285
public static class Solution1 {
296
/**
307
* credit: https://discuss.leetcode.com/topic/59314/java-solution:
31-
*
8+
* <p>
329
* 1. find the length of the number where the nth digit is from 2. find the actual number where
3310
* the nth digit is from 3. find the nth digit and return
3411
*/

0 commit comments

Comments
 (0)