摘要: 2023-11-09 18. 四数之和 - 力扣(LeetCode) 思路:类似 15.3数之和 都是双指针的解法 时间复杂度为o(n3) class Solution { public List<List<Integer>> fourSum(int[] nums, int target) { // 阅读全文
posted @ 2023-11-09 21:47 追梦•少年 阅读(13) 评论(0) 推荐(0)
摘要: 2023-11-09 15. 三数之和 - 力扣(LeetCode) 思路: 此题并不适合哈希表法,去重问题很麻烦 用双指针法,但是注意:双指针法如果不优化(也就是3层暴力)是超时的 class Solution { public List<List<Integer>> threeSum(int[] 阅读全文
posted @ 2023-11-09 21:39 追梦•少年 阅读(21) 评论(0) 推荐(0)