Simple AC python code, beats 99% of submissions


  • 0
    S
        w = int(sqrt(area))
        while area % w != 0:
            w -= 1
        return [area / w, w]
    

    The trick is to decrease from the sqrt.


Log in to reply
 

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