We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af4c796 commit ac45c39Copy full SHA for ac45c39
contains-duplicate/Sol35229.java
valid-palindrome/Sol35229.java
@@ -0,0 +1,24 @@
1
+import java.util.Stack;
2
+
3
+public class Sol35229 {
4
5
+ class Solution {
6
+ public boolean isPalindrome(String s) {
7
+ s = s.toLowerCase().replaceAll("[^a-z0-9]", "");
8
+ int left = 0;
9
+ int right = s.length() - 1;
10
+ while (left < right) {
11
+ if (s.charAt(left) != s.charAt(right)) {
12
+ return false;
13
+ }
14
+ left++;
15
+ right--;
16
17
+ return true;
18
19
+// boolean isLowerCase(Character c) {
20
+// return (int) c > 96 && (int) c < 123 ? true : false;
21
+// }
22
23
+}
24
0 commit comments