摘要: 1、暴力枚举+链表元素去重 不出意外直接超时 class Solution { public List<List<Integer>> threeSum(int[] nums) { int size = nums.length; //枚举所有结果 Arrays.sort(nums); List<Lis 阅读全文
posted @ 2025-04-17 21:46 破忒头头 阅读(22) 评论(0) 推荐(0)
摘要: 暴力枚举 O(N) class Solution { public int[] twoSum(int[] nums, int target) { int size = nums.length; for(int i = 0; i < size; i++){ for(int j = i + 1; j < 阅读全文
posted @ 2025-04-17 20:14 破忒头头 阅读(16) 评论(0) 推荐(0)