Skip to content

Commit 30d8b04

Browse files
committed
chore: removed abs
1 parent 8c54c74 commit 30d8b04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

String/AlphaNumericPalindrome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const alphaNumericPalindrome = (str) => {
2121

2222
// removing all the special characters and turning everything to lowercase
2323
const newStr = str.replace(/[^a-z0-9]+/ig, '').toLowerCase()
24-
const midIndex = newStr.length >> 1 // x >> y = floor(|x| / 2^y)
24+
const midIndex = newStr.length >> 1 // x >> y = floor(x / 2^y)
2525

2626
for (let i = 0; i < midIndex; i++) {
2727
if (newStr.at(i) !== newStr.at(~i)) { // ~n = -(n + 1)

0 commit comments

Comments
 (0)