Skip to content

Commit 4f3d5a2

Browse files
author
jinvicky
committed
lint fix
1 parent 90b51aa commit 4f3d5a2

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

two-sum/jinvicky.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66
*/
77
class Solution {
88

9-
/**
10-
* brute force 풀이
11-
*/
12-
// public int[] twoSumByBruteForce(int[] nums, int target) {
13-
// for (int i = 0; i < nums.length; i++) {
14-
// for (int j = i + 1; j < nums.length; j++) {
15-
// if (nums[i] + nums[j] == target) {
16-
// return new int[]{i, j};
17-
// }
18-
// }
19-
// }
20-
// return new int[2];
21-
// }
9+
public int[] twoSumByBruteForce(int[] nums, int target) {
10+
for (int i = 0; i < nums.length; i++) {
11+
for (int j = i + 1; j < nums.length; j++) {
12+
if (nums[i] + nums[j] == target) {
13+
return new int[]{i, j};
14+
}
15+
}
16+
}
17+
return new int[2];
18+
}
19+
2220
public int[] twoSum(int[] nums, int target) {
2321
Map<Integer, Integer> numberMap = new HashMap<>();
2422

0 commit comments

Comments
 (0)