Python easy and concise solution


  • 1
    def minSteps(self, n):
        if n == 1: return 0
        for i in range(2, n+1):
            if n % i == 0:
                return self.minSteps(n / i) + i

Log in to reply
 

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