摘要:
class Solution { public List<List<Integer>> threeSum(int[] nums) { Arrays.sort(nums); List<List<Integer>> ans = new ArrayList<>(); int n = nums.length 阅读全文
摘要:
双指针 class Solution { public void moveZeroes(int[] nums) { int j=0; for(int i=0;i<nums.length;i++){ if(nums[i]!=0){ int tmp=nums[i]; nums[i]=nums[j]; n 阅读全文
摘要:
class Solution { public int longestConsecutive(int[] nums) { Set<Integer>set=new HashSet<>(); for(int num:nums){ set.add(num); } int ans=0; for(int x: 阅读全文