Skip to content

Commit fc6f67f

Browse files
togo26dahyeong-yun
andauthored
Update valid-palindrome/togo26.js
Remove unnecessary regex construction Co-authored-by: polymorph <33543196+dahyeong-yun@users.noreply.github.com>
1 parent bc0a604 commit fc6f67f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

valid-palindrome/togo26.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var isPalindrome = function (s) {
1212
// TC: O(n) / SC: O(1)
1313
// With two pointers
1414
var isPalindrome = function (s) {
15-
const nonAlphanumeric = new RegExp(/[^a-zA-Z0-9]+/);
15+
const nonAlphanumeric = /[^a-zA-Z0-9]+/;
1616
let left = 0;
1717
let right = s.length - 1;
1818

0 commit comments

Comments
 (0)