Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1d63f30

Browse filesBrowse files
committed
commit
1 parent c56b25a commit 1d63f30
Copy full SHA for 1d63f30

File tree

Expand file treeCollapse file tree

15 files changed

+245
-185
lines changed
Filter options
Expand file treeCollapse file tree

15 files changed

+245
-185
lines changed

‎.idea/encodings.xml

Copy file name to clipboardExpand all lines: .idea/encodings.xml
+2-2Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml

Copy file name to clipboardExpand all lines: .idea/modules.xml
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/workspace.xml

Copy file name to clipboardExpand all lines: .idea/workspace.xml
+205-149Lines changed: 205 additions & 149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎[0013][Roman To Integer]/[0013][Roman To Integer].iml

Copy file name to clipboardExpand all lines: [0013][Roman To Integer]/[0013][Roman To Integer].iml
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,15 @@
99
<orderEntry type="sourceFolder" forTests="false" />
1010
<orderEntry type="library" name="R User Library" level="project" />
1111
<orderEntry type="library" name="R Skeletons" level="application" />
12+
<orderEntry type="module-library">
13+
<library name="JUnit4">
14+
<CLASSES>
15+
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
16+
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
17+
</CLASSES>
18+
<JAVADOC />
19+
<SOURCES />
20+
</library>
21+
</orderEntry>
1222
</component>
1323
</module>

‎[0015][3 Sum]/[0015][3 Sum].iml

Copy file name to clipboardExpand all lines: [0015][3 Sum]/[0015][3 Sum].iml
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,25 @@
99
<orderEntry type="sourceFolder" forTests="false" />
1010
<orderEntry type="library" name="R User Library" level="project" />
1111
<orderEntry type="library" name="R Skeletons" level="application" />
12+
<orderEntry type="module-library">
13+
<library name="testng">
14+
<CLASSES>
15+
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/7.0.0-beta4/testng-7.0.0-beta4.jar!/" />
16+
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.72/jcommander-1.72.jar!/" />
17+
</CLASSES>
18+
<JAVADOC />
19+
<SOURCES />
20+
</library>
21+
</orderEntry>
22+
<orderEntry type="module-library">
23+
<library name="JUnit4">
24+
<CLASSES>
25+
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
26+
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
27+
</CLASSES>
28+
<JAVADOC />
29+
<SOURCES />
30+
</library>
31+
</orderEntry>
1232
</component>
1333
</module>

‎[0015][3 Sum]/src/Solution.java

Copy file name to clipboardExpand all lines: [0015][3 Sum]/src/Solution.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public List<List<Integer>> threeSum(int[] nums) {
7070
}
7171
}
7272

73+
// nums[a-1]已经被选过了,不用再选了
7374
do {
7475
++a;
7576
}while (a < nums.length - 2 && nums[a - 1] == nums[a]);

‎[0016][3 Sum Closest]/src/Solution.java

Copy file name to clipboardExpand all lines: [0016][3 Sum Closest]/src/Solution.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public int threeSumClosest(int[] nums, int target) {
7474
// 以上的设置在下一次元素处理时生效
7575
}
7676

77-
7877
// 和大于target
7978
if (sum > target) {
8079
do {

‎[0017][Letter Combinations Of A Phon Number/[0017][LetterCombinationsOfAPhonNumber ].iml

Copy file name to clipboardExpand all lines: [0017][Letter Combinations Of A Phon Number/[0017][LetterCombinationsOfAPhonNumber ].iml
-13Lines changed: 0 additions & 13 deletions
This file was deleted.

‎[0018][4 Sum]/[0018][4Sum].iml

Copy file name to clipboardExpand all lines: [0018][4 Sum]/[0018][4Sum].iml
-13Lines changed: 0 additions & 13 deletions
This file was deleted.

‎[0018][4 Sum]/src/Solution.java

Copy file name to clipboardExpand all lines: [0018][4 Sum]/src/Solution.java
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ public List<List<Integer>> fourSum(int[] num, int target) {
4949
Arrays.sort(num);
5050

5151
// 第一个加数
52-
for (int i = 0; i < num.length - 3; i++) {
53-
// 第一个加数使用不重复
54-
if (i > 0 && num[i] == num[i - 1]) {
55-
continue;
56-
}
57-
52+
for (int i = 0; i < num.length - 3;) {
5853
// 第四个加数
5954
for (int j = num.length - 1; j > i + 2; j--) {
6055
// 第四个加数使用不重复
@@ -99,6 +94,11 @@ public List<List<Integer>> fourSum(int[] num, int target) {
9994
}
10095
}
10196
}
97+
98+
// 相同的数字作为处理只能使用一次
99+
do {
100+
i++;
101+
}while (i < num.length - 2 && num[i - 1] == num[i]);
102102
}
103103
return result;
104104
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.