2024年12月13日
摘要: 15. 三数之和 - 力扣(LeetCode) 代码随想录 (programmercarl.com) 方法一:双指针法 class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: res = [] nums.sort 阅读全文
posted @ 2024-12-13 20:59 axuu 阅读(23) 评论(0) 推荐(0)
摘要: 383. 赎金信 - 力扣(LeetCode) 代码随想录 方法1:数组 all(...) all 函数用于检查迭代器中的所有条件是否都为 True。 如果任意一个条件为 False,all 会返回 False。 方法2:使用defaultdict 我的代码: 代码随想录的代码: 方法3:使用字典 阅读全文
posted @ 2024-12-13 09:48 axuu 阅读(46) 评论(0) 推荐(0)