Construct the Rectangle

2017/12/11 posted in  leetcode

class Solution {
public:
    vector<int> constructRectangle(int area) {
        for(int mid = sqrt(area); mid>0; mid--)
            if (!(area%mid))
                return {area/mid, mid};
    }
};