Last active
August 4, 2020 02:14
-
-
Save UNISERVO1/2342925e94df038f3dd6e1557f8e51aa to your computer and use it in GitHub Desktop.
August LeetCoding Challenge Week 1: Day 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
fun isPalindrome(s: String): Boolean { | |
val targetString: String = s.filter{ it.isLetterOrDigit() }.toLowerCase() | |
return targetString == targetString.reversed() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment