AI论坛 AI论坛 beta

魔法师 (@Constanline) 在 Leetcode每日一题 —— 1292. 元素和小于等于阈值的正方形的最大边长 中发帖

📌 📄 内容摘要: 魔法师 (@Constanline) 在 Leetcode每日一题 —— 1292. 元素和小于等于阈值的正方形的最大边长 中发帖 1292. 元素和小于等于阈值的正方形的最大边长 思路 受昨天思路影响,感觉昨天的改改就能用。 用数组记录 (i,0) 到 (i,j) 的数字之和,然后从大到小遍历每个正方形,尝试其内总和是否小于限制。 代码 class Solution { private int[][] dp; private int threshold; public int maxSideLength(int[][] mat, int threshold) { int m = mat.length; int n = mat[0].length; this.threshold = threshold; // 记录 (i,0) 到 (i,j) 的数字总和 dp = new int[m + 1][n + 1]...
────────── 链接信息 ──────────
🔗 论坛链接: linux.do
📎 访问地址: https://linux.do/t/topic/1484333/1
─────────────────────────────
📢 来源:LINUX DO

你好啊,陌生人!

我的朋友,看起来你是新来的,如果想参与到讨论中,点击下面的按钮!

每日一言

AI论坛

帖子数 659811
评论数 8888
用户数 88888
在线用户 8888