会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
habibah_chang
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
8
9
10
11
12
13
14
15
16
···
44
下一页
2021年3月2日
310. Minimum Height Trees
摘要: 问题: 求给定无向图(树),从那个顶点作为root,得到最矮树。 Example 1: Input: n = 4, edges = [[1,0],[1,2],[1,3]] Output: [1] Explanation: As shown, the height of the tree is 1 w
阅读全文
posted @ 2021-03-02 13:57 habibah_chang
阅读(43)
评论(0)
推荐(0)
2021年3月1日
279. Perfect Squares
摘要: 问题: 给定数字n,求将其分解为多个平方数的和,最少用多少个平方数可以得到。 Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4. Example 2: Input: n = 13 Output: 2 Explanation:
阅读全文
posted @ 2021-03-01 17:41 habibah_chang
阅读(57)
评论(0)
推荐(0)
2021年2月28日
675. Cut Off Trees for Golf Event
摘要: 问题: 给定二维数组,每个格子: 0:代表不可行走,不可种树 1:代表可行走,未种树 x>1:代表,种了高x的树 从forest[0][0]开始出发,从最低高度的树开始砍伐,依次向更高的树前进进行砍伐。 问是否最终能砍完所有的树。 可以的话,返回行走步数。不可以的话,返回-1。 ⚠️ 注意:从[0]
阅读全文
posted @ 2021-02-28 11:58 habibah_chang
阅读(110)
评论(0)
推荐(0)
210. Course Schedule II
摘要: 问题: 给定编号为0~numCourses-1 的课程,以及课程的依赖关系prerequisites 其中prerequisites[i] = [ai, bi],ai之前必须先上了bi的课程。 bi->ai 若能够上完所有的课程,给出一个上课顺序。 否则,返回空数组。 Example 1: Inpu
阅读全文
posted @ 2021-02-28 10:08 habibah_chang
阅读(40)
评论(0)
推荐(0)
2021年2月27日
407. Trapping Rain Water II
摘要: 问题: 给定二维数组,表示各个位置上建筑的高度。 求下雨累计雨量最多为多少? Example: Given the following 3x6 height map: [ [1,4,3,1,3,2], [3,2,1,3,2,4], [2,3,3,2,3,1] ] Return 4. The abov
阅读全文
posted @ 2021-02-27 13:15 habibah_chang
阅读(61)
评论(0)
推荐(0)
301. Remove Invalid Parentheses
摘要: 问题: 给定一个字符串,包含左右小括号+字母。 对该字符串进行【括号删减】,使得 字符串中括号完全匹配。"( )" 求最少删减字符,能得到的所有完全匹配的字符串。 Example 1: Input: "()())()" Output: ["()()()", "(())()"] Example 2:
阅读全文
posted @ 2021-02-27 11:20 habibah_chang
阅读(87)
评论(0)
推荐(0)
2021年2月26日
207. Course Schedule
摘要: 问题: 给定编号为:0~numCourses-1 ,numCourses门课。 以及课程依赖关系:prerequisites,prerequisites[x][0] 依赖 prerequisites[x][1] 即得先上 prerequisites[x][1] 课程,才能上prerequisites
阅读全文
posted @ 2021-02-26 15:32 habibah_chang
阅读(67)
评论(0)
推荐(0)
199. Binary Tree Right Side View
摘要: 问题: 给定二叉树,求从右边观察这棵树,能看到的每层第一个元素。 Example 1: Input: root = [1,2,3,null,5,null,4] Output: [1,3,4] Example 2: Input: root = [1,null,3] Output: [1,3] Exam
阅读全文
posted @ 2021-02-26 13:26 habibah_chang
阅读(54)
评论(0)
推荐(0)
2021年2月25日
133. Clone Graph
摘要: 问题: 给定一个图,对该图进行深拷贝,返回拷贝出来的图。 adj[i]:代表节点 i 所相邻的节点。 Example 1: Input: adjList = [[2,4],[1,3],[2,4],[1,3]] Output: [[2,4],[1,3],[2,4],[1,3]] Explanation
阅读全文
posted @ 2021-02-25 14:35 habibah_chang
阅读(78)
评论(0)
推荐(0)
130. Surrounded Regions
摘要: 问题: 给定一个m*n棋盘,由O和X填入。 将棋盘中被X包围的O转化成X。 说明:在四周边缘的O,以及和这些O相邻(上下左右相邻)的O,无法转化。其他的棋盘内部O皆可转化为X。 Example 1: Input: board = [["X","X","X","X"],["X","O","O","X"
阅读全文
posted @ 2021-02-25 13:15 habibah_chang
阅读(98)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
16
···
44
下一页
公告