4 lines javascript solution


  • 0
    Z
    if(area < 2) return [area,area];
    var w = Number.parseInt(Math.sqrt(area));
    while(area % w !== 0) w--;
    return [area/w,w];

Log in to reply
 

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