11 2021 档案

摘要:题目 476. 数字的补数 解法 进制转换 进制转换有一个固定的模板,我是用的比较直观的一种方式 class Solution { /** * @param Integer num@returnInteger/functionfindComplement(num) { $ret 阅读全文
posted @ 2021-11-13 14:28 吴丹阳-V 阅读(34) 评论(0) 推荐(0) 编辑
摘要:题目 463. 岛屿的周长 解法 依题遍历陆地的四个边,如果靠近水,那么算到周长里面,否则不算 <?php class Solution { /** * @param Integer[][] grid@returnInteger/functionislandPerimeter(g 阅读全文
posted @ 2021-11-12 12:19 吴丹阳-V 阅读(44) 评论(0) 推荐(0) 编辑
摘要:题目 https://leetcode-cn.com/problems/repeated-substring-pattern/ 解法 每次用不同的子字符串去匹配, 大概20分钟从看题目到写出来答案,直觉思路 class Solution { /** * @param String $s * @ret 阅读全文
posted @ 2021-11-10 13:37 吴丹阳-V 阅读(29) 评论(0) 推荐(0) 编辑
摘要:题目 https://leetcode-cn.com/problems/assign-cookies/ 解法 直觉思路 先排序,然后根据胃口最小的孩子找能满足的最小的饼干 class Solution { /** * @param Integer[] g@paramInteger[]s 阅读全文
posted @ 2021-11-09 22:49 吴丹阳-V 阅读(25) 评论(0) 推荐(0) 编辑
摘要:题目 https://leetcode-cn.com/problems/minimum-moves-to-equal-array-elements/ 解法 这题不会,直接看的题解 意思就是反向思考,每次 n-1 个数字加一,可以认为是一个数字减一,直到所有数字相等 那只能是所有的数字减到最小值才能使 阅读全文
posted @ 2021-11-08 20:24 吴丹阳-V 阅读(55) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示