Skip to content

Commit 1fac60a

Browse files
author
jinvicky
committed
lint fix
1 parent 846f4ae commit 1fac60a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

contains-duplicate/jinvicky.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
class Solution {
44
public boolean containsDuplicate(int[] nums) {
55
Set<Integer> set = new HashSet<>();
6-
for(int num : nums) {
7-
if(!set.add(num)) return true;
6+
for (int num : nums) {
7+
if (!set.add(num)) return true;
88
}
99
return false;
1010
}

two-sum/jinvicky.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import java.util.Map;
33

44
/**
5-
본래 brute force로 이중 for문으로 풀었다가 map으로 최적화.
5+
* 본래 brute force로 이중 for문으로 풀었다가 map으로 최적화.
66
*/
77
class Solution {
88
/**
@@ -18,15 +18,14 @@ class Solution {
1818
// }
1919
// return new int[2];
2020
// }
21-
2221
public int[] twoSum(int[] nums, int target) {
2322
Map<Integer, Integer> numberMap = new HashMap<>();
2423
for (int i = 0; i < nums.length; i++) {
2524
int required = target - nums[i];
2625
Integer index = numberMap.get(required);
2726

2827
if (index != null) {
29-
return new int[] { index, i };
28+
return new int[]{index, i};
3029
}
3130
numberMap.put(nums[i], i);
3231
}

0 commit comments

Comments
 (0)