Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 256 Bytes
class Solution:
def newInteger(self, n):
"""
:type n: int
:rtype: int
"""
s = ''
while n >= 9:
s += str(n % 9)
n //= 9
s += str(n)
return int(''.join(reversed(s)))