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

题目:

题解:

python 复制代码
class Solution:
    def constructRectangle(self, area: int) -> List[int]:
        w = int(sqrt(area))
        while area % w:
            w -= 1
        return [area // w, w]
相关推荐
孤狼warrior8 小时前
图像生成 Stable Diffusion模型架构介绍及使用代码 附数据集批量获取
人工智能·python·深度学习·stable diffusion·cnn·transformer·stablediffusion
TracyCoder1238 小时前
LeetCode Hot100(2/100)——49. 字母异位词分组 (Group Anagrams)。
算法·leetcode
大哥手下留情8 小时前
Python火车票查询方法介绍
开发语言·python
努力毕业的小土博^_^8 小时前
【AI课程领学】第十二课 · 超参数设定与网络训练(课时1) 网络超参数设定:从“要调什么”到“怎么系统地调”(含 PyTorch 可复用模板)
人工智能·pytorch·python·深度学习·神经网络·机器学习
YMLT花岗岩8 小时前
Python学习之-函数-入门训练-在函数中修改全局变量
python·学习
TracyCoder1238 小时前
LeetCode Hot100(3/100)——128.最长连续序列
算法·leetcode
花月mmc8 小时前
CanMV K230 波形识别——数据分析(2)
python·数据挖掘·数据分析·信号处理
进击的小头9 小时前
传递函数与系统特性(核心数学工具)
python·算法·数学建模
程序员-King.9 小时前
day168—递归—二叉树的最大路径和(LeetCode-124)
算法·leetcode·深度优先·递归
小王努力学编程9 小时前
LangChain——AI应用开发框架(核心组件2)
linux·服务器·c++·人工智能·python·langchain·信号