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 5acf128 commit 9401d25Copy full SHA for 9401d25
valid-palindrome/nakjun12.ts
@@ -0,0 +1,11 @@
1
+function isPalindrome(s: string): boolean {
2
+ const convertWord = s.toLowerCase().match(/[a-z0-9]/g) ?? [];
3
+ const length = convertWord.length;
4
+ for (let i = 0; i < length / 2; i++) {
5
+ if (convertWord[i] !== convertWord[length - 1 - i]) {
6
+ return false;
7
+ }
8
9
+
10
+ return true;
11
+}
0 commit comments