Skip to content

Commit 4fd0e7a

Browse files
author
Heeseung Koo
committed
w03: 125. Valid Palindrome
1 parent 04ed987 commit 4fd0e7a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

valid-palindrome/nrudev.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function isPalindrome(s: string): boolean {
2+
const str = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, "");
3+
return str === str.split("").reverse().join("");
4+
}

0 commit comments

Comments
 (0)