技术栈

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

Mopes__2024-10-21 23:15

题目:

题解:

python 复制代码
class Solution:
    def constructRectangle(self, area: int) -> List[int]:
        w = int(sqrt(area))
        while area % w:
            w -= 1
        return [area // w, w]
上一篇:正则表达式基础学习
下一篇:2. MySQL数据库基础
相关推荐
xlp666hub
6 小时前
Leetcode第二题:用 C++ 解决字母异位词分组
c++·leetcode
明月_清风
9 小时前
Python 装饰器前传:如果不懂“闭包”,你只是在复刻代码
后端·python
明月_清风
9 小时前
打破“死亡环联”:深挖 Python 分代回收与垃圾回收(GC)机制
后端·python
xlp666hub
1 天前
Leetcode第一题:用C++解决两数之和问题
c++·leetcode
ZhengEnCi
1 天前
08c. 检索算法与策略-混合检索
后端·python·算法
明月_清风
1 天前
Python 内存手术刀:sys.getrefcount 与引用计数的生死时速
后端·python
明月_清风
1 天前
Python 消失的内存:为什么 list=[] 是新手最容易踩的“毒苹果”?
后端·python
Flittly
2 天前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(3)TodoWrite (待办写入)
python·agent
千寻girling
2 天前
一份不可多得的 《 Django 》 零基础入门教程
后端·python·面试
databook
2 天前
探索视觉的边界:用 Manim 重现有趣的知觉错觉
python·动效
热门推荐
01GitHub 镜像站点02OpenClaw 使用和管理 MCP 完全指南03OpenClaw 连接飞书完整指南:插件安装、配置与踩坑记录04Window 10部署openclaw报错node.exe : npm error code 12805本地部署 OpenClaw + DeepSeek-R1 完全指南06OpenClaw + 飞书(Feishu)环境搭建指南07npm-error code 128问题解决方法08Clawdbot部署教程:解决‘gateway token missing’授权问题的完整步骤09Claude Code + GLM4.7 避坑指南:解决 Unable to connect to Anthropic services10OpenClaw 飞书机器人不回复消息?3 小时踩坑总结