File tree 1 file changed +0
-27
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .math .BigInteger ;
4
4
5
- /**
6
- * 483. Smallest Good Base
7
- *
8
- * For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1.
9
-
10
- Now given a string representing n, you should return the smallest good base of n in string format.
11
-
12
- Example 1:
13
- Input: "13"
14
- Output: "3"
15
- Explanation: 13 base 3 is 111.
16
-
17
- Example 2:
18
- Input: "4681"
19
- Output: "8"
20
- Explanation: 4681 base 8 is 11111.
21
-
22
- Example 3:
23
- Input: "1000000000000000000"
24
- Output: "999999999999999999"
25
- Explanation: 1000000000000000000 base 999999999999999999 is 11.
26
-
27
- Note:
28
- The range of n is [3, 10^18].
29
- The string representing n is always valid and will not have leading zeros.
30
-
31
- */
32
5
public class _483 {
33
6
34
7
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments