w = int(sqrt(area))
while area % w != 0:
w -= 1
return [area / w, w]
The trick is to decrease from the sqrt.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.