Golang | Leetcode Golang题解之第492题构造矩形

题目:

题解:

Go 复制代码
func constructRectangle(area int) []int {
    w := int(math.Sqrt(float64(area)))
    for area%w > 0 {
        w--
    }
    return []int{area / w, w}
}
相关推荐
倦王18 分钟前
力扣日刷47-补
python·算法·leetcode
无限进步_1 小时前
【C++】巧用静态变量与构造函数:一种非常规的求和实现
开发语言·c++·git·算法·leetcode·github·visual studio
凌波粒2 小时前
LeetCode--344.反转字符串(字符串/双指针法)
算法·leetcode·职场和发展
啊哦呃咦唔鱼2 小时前
LeetCode hot100-543 二叉树的直径
算法·leetcode·职场和发展
样例过了就是过了3 小时前
LeetCode热题100 爬楼梯
c++·算法·leetcode·动态规划
ThisIsMirror4 小时前
leetcode 452 Arrays.sort()排序整数溢出、Integer.compare(a[1], b[1])成功的问题
算法·leetcode
x_xbx5 小时前
LeetCode:438. 找到字符串中所有字母异位词
算法·leetcode·职场和发展
m0_694845575 小时前
UVdesk部署教程:企业级帮助台系统实践
服务器·开发语言·后端·golang·github
@atweiwei5 小时前
Go语言面试篇数据结构底层原理精讲(下)
数据结构·面试·golang
派大星~课堂5 小时前
【力扣-94.二叉树的中序遍历】Python笔记
笔记·python·leetcode