Skip to main content
6 of 11
Rectified the code in "explanation" so as it reflects the change in the main code; I admit I changed "higher" to "grater" to reach the at-least-6-chars limitation, but I do think it's a grammatical improvement.

Python 3, 91 78 75 71 66 bytes

@Emigna shaved off 5 bytes.

Input Format: As allowed by the meta consensus, functions may output by modifying their parameters, and not necessarily returning the modified parameters (the TIO link includes return i):

def g(i):
 while'9'>max(i)and len(i)>1:i=str(int(i,int(max(i))+1))

Try it online!


def g(i):                                  - creates a function g with a string parameter i
 while '9'>max(i)and len(i)>1:             - repeatedly checks if the number is still base-9 or lower and has a length greater than 1
    i=str(...)                             - assigns i to the string representation of ...
      int(i,int(max(i))+1)                 - converts the current number to the real base 10 and loops back again
Mr. Xcoder
  • 42.4k
  • 9
  • 79
  • 214