We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e4c3dc commit e8e6de1Copy full SHA for e8e6de1
1 file changed
3sum/dohyeon2.java
@@ -4,7 +4,7 @@
4
5
class Solution {
6
// TC: O(n^2)
7
- // SC: O(1)
+ // SC: O(n^2)
8
public List<List<Integer>> threeSum(int[] nums) {
9
List<List<Integer>> answer = new ArrayList<List<Integer>>();
10
@@ -41,11 +41,9 @@ public List<List<Integer>> threeSum(int[] nums) {
41
42
left++;
43
right--;
44
- }
45
- if (sum < 0) {
+ } else if (sum < 0) {
46
47
48
- if (sum > 0) {
+ } else {
49
50
}
51
0 commit comments