Skip to content

Commit 5ebb199

Browse files
committed
리베이스를 위한 변경사항 커밋
1 parent e3afb1e commit 5ebb199

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

contains-duplicate/river20s.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import java.util.HashSet;
2-
3-
class Solution {
4-
public boolean containsDuplicate(int[] nums) {
5-
HashSet<Integer> set = new HashSet<>();
6-
7-
for (int num : nums) {
8-
if (!set.add(num)) {
9-
return true;
10-
}
11-
}
12-
13-
return false;
14-
}
1+
import java.util.HashSet;
2+
3+
class Solution {
4+
public boolean containsDuplicate(int[] nums) {
5+
HashSet<Integer> set = new HashSet<>();
6+
7+
for (int num : nums) {
8+
if (!set.add(num)) {
9+
return true;
10+
}
11+
}
12+
13+
return false;
14+
}
1515
}

valid-palindrome/river20s.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
class Solution {
2-
public boolean isPalindrome(String s) {
3-
4-
// 문자열 s의 대문자를 소문자로 치환한다.
5-
String lowerCase = s.toLowerCase();
6-
// 소문자 a-z, 숫자 0-9에 해당하지 않는 문자를 지운다.
7-
String alphanumeric = lowerCase.replaceAll("[^a-z0-9]", "");
8-
// 뒤집은 문자열을 만든다.
9-
String reverse = new StringBuilder(alphanumeric).reverse().toString();
10-
// 두 문자열을 비교한다.
11-
boolean isEqual = alphanumeric.equals(reverse);
12-
13-
return isEqual;
14-
}
1+
class Solution {
2+
public boolean isPalindrome(String s) {
3+
4+
// 문자열 s의 대문자를 소문자로 치환한다.
5+
String lowerCase = s.toLowerCase();
6+
// 소문자 a-z, 숫자 0-9에 해당하지 않는 문자를 지운다.
7+
String alphanumeric = lowerCase.replaceAll("[^a-z0-9]", "");
8+
// 뒤집은 문자열을 만든다.
9+
String reverse = new StringBuilder(alphanumeric).reverse().toString();
10+
// 두 문자열을 비교한다.
11+
boolean isEqual = alphanumeric.equals(reverse);
12+
13+
return isEqual;
14+
}
1515
}

0 commit comments

Comments
 (0)