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 8887ab8 commit 1774ef3Copy full SHA for 1774ef3
valid-palindrome/gmlwls96.kt
@@ -0,0 +1,12 @@
1
+class Solution {
2
+ fun isPalindrome(s: String): Boolean {
3
+ val filterStr = s
4
+ .lowercase()
5
+ .filter { it in 'a'..'z' }
6
+ if (filterStr.isEmpty()) return true
7
+ for (i in 0..filterStr.lastIndex / 2) {
8
+ if (filterStr[i] != filterStr[filterStr.lastIndex - i]) return false
9
+ }
10
+ return true
11
12
+}
0 commit comments