Easy Understand Python


  • 0
    F
    class Solution(object):
        def constructRectangle(self, area):
            """
            :type area: int
            :rtype: List[int]
            """
            son = [area,1]
            sqr = int(area**0.5)+1
            for i in xrange(2,sqr):
                if area % i == 0:
                    son.append(i)
                    son = [area/i] + son
            return [son[0],son[-1]]
    

Log in to reply
 

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