Given an integer A, we call k >= 2 a good base of A, if all digits of A base k are 1.
Now given a string representing A, you should return the smallest good base of A in string format.
The only argument given is the string representing A.
Return the smallest good base of A in string format.
3 <= A <= 10^18
Input 1: A = "13" Output 1: "3" (13 in base 3 is 111) Input 2: A = "4681" Output 2: "8" (4681 in base 8 is 11111).
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.