Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 414 Bytes

492.md

File metadata and controls

28 lines (19 loc) · 414 Bytes

492 Construct the Rectangle

Description

link


Solution

  • See Code

Code

class Solution:
    def constructRectangle(self, area: int) -> List[int]:
        import math
        x = math.sqrt(area)
        L = math.ceil(x)
        while area % L != 0:
            L += 1
        return [L, area//L]