Python simple solution


  • 0
    H
    def smallestFactorization(self, a):
            if a < 10: return a
            ret = ""
            for i in range(9, 1, -1):
                while a % i == 0:
                    ret = str(i) + ret
                    a /= i
            return int(ret) if a == 1 and int(ret) < 2**31 else 0

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.