Skip to content

Commit 94eb0c6

Browse files
authored
Merge pull request gzc426#134 from healthyxxyyhh/master
Create Selfcenter.md
2 parents 9c873fb + b68c10c commit 94eb0c6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Selfcenter.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Solution {
2+
public boolean isPalindrome(String s) {
3+
4+
String t = s.replaceAll("[^A-Za-z0-9]", "");
5+
t = t.toLowerCase();
6+
int start =0;
7+
int end=t.length()-1;
8+
while(start<=end){
9+
if(t.charAt(start)!=t.charAt(end)) {
10+
return false;
11+
}
12+
start++;
13+
end--;
14+
15+
}
16+
17+
return true;
18+
19+
}
20+
}
21+

0 commit comments

Comments
 (0)