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 831b097 commit d39ddcdCopy full SHA for d39ddcd
valid-palindrome/hyunjung-choi.kt
@@ -0,0 +1,9 @@
1
+import java.util.Locale.getDefault
2
+
3
+class Solution {
4
+ fun isPalindrome(s: String): Boolean {
5
+ if (s.isBlank()) return true
6
+ val cleanedString = s.trim().filter { it.isLetterOrDigit() }.lowercase(getDefault())
7
+ return cleanedString == cleanedString.reversed()
8
+ }
9
+}
0 commit comments