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