Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Good Radix by bravebug
from string import ascii_uppercase, digits
DIGITS = digits + ascii_uppercase
def checkio(number):
minimal_radix = DIGITS.index(max(number)) + 1
for radix in range(minimal_radix, len(DIGITS) + 1):
number_as_decimal = int(number, radix)
if not number_as_decimal % (radix - 1):
return radix
return 0
Sept. 25, 2021