Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@@ -16,10 +16,13 @@ public class ThreeSumProblem {
arr[i] = scan.nextInt();
}
ThreeSumProblem th = new ThreeSumProblem();
System.out.println("Brute Force Approach\n" + (th.BruteForce(arr, ts)) + "\n");
System.out.println("Two Pointer Approach\n" + (th.TwoPointer(arr, ts)) + "\n");
System.out.println(
"Brute Force Approach\n" + (th.BruteForce(arr, ts)) + "\n"
);
System.out.println(
"Two Pointer Approach\n" + (th.TwoPointer(arr, ts)) + "\n"
);
System.out.println("Hashmap Approach\n" + (th.Hashmap(arr, ts)));
}
public List<List<Integer>> BruteForce(int[] nums, int target) {
@@ -36,11 +39,11 @@ public class ThreeSumProblem {
Collections.sort(temp);
arr.add(temp);
}
}
}
}
arr = new ArrayList<List<Integer>>(new LinkedHashSet<List<Integer>>(arr));
arr =
new ArrayList<List<Integer>>(new LinkedHashSet<List<Integer>>(arr));
return arr;
}
@@ -67,7 +70,6 @@ public class ThreeSumProblem {
} else {
end -= 1;
}
}
i++;
}
@@ -98,5 +100,4 @@ public class ThreeSumProblem {
}
return new ArrayList(ts);
}
}