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 063cbd4 commit 73cd02dCopy full SHA for 73cd02d
valid-palindrome/gwbaik9717.js
@@ -6,11 +6,7 @@
6
* @return {boolean}
7
*/
8
var isPalindrome = function (s) {
9
- const normalize = (s) => {
10
- return s.toLowerCase().replace(/[^a-z0-9]/g, "");
11
- };
12
-
13
- const normalized = normalize(s);
+ const normalized = s.toLowerCase().replace(/[^a-z0-9]/g, "");
14
const reversed = normalized.split("").reverse().join("");
15
16
return normalized === reversed;
0 commit comments