上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 44 下一页
摘要: 问题: 给定二叉树,进行层序遍历,从底层向上输出。 Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[15,7],[9,20],[3]] Example 2: Input: root = [1] Output: [[1]] Exam 阅读全文
posted @ 2021-02-25 11:26 habibah_chang 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 问题: 求二叉树的正反交替层序遍历。 第一层从左向右,第二次从右向左... Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[3],[20,9],[15,7]] Example 2: Input: root = [1] Output 阅读全文
posted @ 2021-02-24 17:35 habibah_chang 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 问题: 求二叉树的层序遍历。 Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[3],[9,20],[15,7]] Example 2: Input: root = [1] Output: [[1]] Example 3: Inpu 阅读全文
posted @ 2021-02-24 17:06 habibah_chang 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个公司的上下级关系 [id, importance, [subordinates]] [本员工id,本员工权值,[本员工的下属们的id]] 求给定员工id,的所有下属员工+自己的权值。 Example 1: Input: [[1, 5, [2, 3]], [2, 3, []], [3, 阅读全文
posted @ 2021-02-23 14:41 habibah_chang 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 问题: 将一组jobs分配给k个人,求完成这些job,最小需要的时间。 Example 1: Input: jobs = [3,2,3], k = 3 Output: 3 Explanation: By assigning each person one job, the maximum time 阅读全文
posted @ 2021-02-23 12:13 habibah_chang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个数字n 则有一个1,从2~n各个数字两个。 进行排序,使得除了1之外任意两个相同数字直接的距离=数字自己。 得到一个字母序最大的解。 Example 1: Input: n = 3 Output: [3,1,2,3,2] Explanation: [2,3,2,1,3] is als 阅读全文
posted @ 2021-02-22 15:48 habibah_chang 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一组数字,将其等分成k个个数相同的子数组。 求划分后,得到所有子数组最小差分和。 差分:子数组中,最大值-最小值 Example 1: Input: nums = [1,2,1,4], k = 2 Output: 4 Explanation: The optimal distributi 阅读全文
posted @ 2021-02-21 15:07 habibah_chang 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定m*n的格子,每个格子可以住人。 给定introvertsCount个内向的人,extrovertsCount个外向的人。 求分配所有人的住法,使得快乐值最大。 其中快乐值: 一个内向的人,初始快乐值=120 一个外向的人,初始快乐值=40 内向人周围多一个邻居,快乐值-30 外向人周围 阅读全文
posted @ 2021-02-20 13:41 habibah_chang 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 问题: 用a,e,i,o,u构成字符串,前面的字符一定是后面字符的字母序之前。 构成长度为n的字符串,有多少种方法。 Example 1: Input: n = 1 Output: 5 Explanation: The 5 sorted strings that consist of vowels 阅读全文
posted @ 2021-02-14 16:41 habibah_chang 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一组数,将其分配给多个用户, 每个用户要求quantity[i]个相同的数。 问是否能够分配完。 Example 1: Input: nums = [1,2,3,4], quantity = [2] Output: false Explanation: The 0th customer 阅读全文
posted @ 2021-02-14 14:46 habibah_chang 阅读(83) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 44 下一页