技术栈

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数据库基础
相关推荐
明月_清风
7 小时前
Python 内存手术刀:sys.getrefcount 与引用计数的生死时速
后端·python
明月_清风
7 小时前
Python 消失的内存:为什么 list=[] 是新手最容易踩的“毒苹果”?
后端·python
Flittly
1 天前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(3)TodoWrite (待办写入)
python·agent
千寻girling
1 天前
一份不可多得的 《 Django 》 零基础入门教程
后端·python·面试
databook
1 天前
探索视觉的边界:用 Manim 重现有趣的知觉错觉
python·动效
明月_清风
1 天前
Python 性能微观世界:列表推导式 vs for 循环
后端·python
明月_清风
1 天前
Python 性能翻身仗:从 O(n) 到 O(1) 的工程实践
后端·python
helloweilei
2 天前
python 抽象基类
python
用户835629078051
2 天前
Python 实现 PPT 转 HTML
后端·python
zone7739
2 天前
004:RAG 入门-LangChain读取PDF
后端·python·面试
热门推荐
01GitHub 镜像站点02OpenClaw 使用和管理 MCP 完全指南03Window 10部署openclaw报错node.exe : npm error code 12804OpenClaw + 飞书(Feishu)环境搭建指南05本地部署 OpenClaw + DeepSeek-R1 完全指南06OpenClaw 连接飞书完整指南:插件安装、配置与踩坑记录07小黑课堂计算机二级WPSoffice题库软件下载安装教程(2026年3月最新版)08Claude Code + GLM4.7 避坑指南:解决 Unable to connect to Anthropic services09OpenClaw 飞书机器人不回复消息?3 小时踩坑总结10Clawdbot部署教程:解决‘gateway token missing’授权问题的完整步骤