Skip to content

Commit 9bb083d

Browse files
authored
Merge pull request gzc426#139 from fsd2018/patch-1
Create 铁男神sama.md
2 parents 92f88c9 + ebf2754 commit 9bb083d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
```Java
2+
class Solution {
3+
public boolean isPalindrome(String s) {
4+
char[] charArray = s.toCharArray();
5+
int index=0;
6+
for(char c:charArray){
7+
if(c>=65&&c<=90 ){
8+
charArray[index++]=c;
9+
}else if(c>=97&&c<=122){
10+
charArray[index++]=(char)(c-32);
11+
}else if(c>=48&&c<=57) {
12+
charArray[index++]=c;
13+
}
14+
}
15+
System.out.print(charArray);
16+
int start=0;
17+
int end=index-1;
18+
while(start<=end){
19+
if(charArray[start]==charArray[end]){
20+
start++;
21+
end--;
22+
}else{
23+
return false;
24+
}
25+
26+
}
27+
return true;
28+
}
29+
}
30+
```
31+

0 commit comments

Comments
 (0)