MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / isPalindrome

Function isPalindrome

javascript/0680-valid-palindrome-ii.js:22–34  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

20};
21
22const isPalindrome = (s) => {
23 let l = 0;
24 let r = s.length - 1;
25
26 while (l < r) {
27 if (s[l] !== s[r]) {
28 return false;
29 }
30 l++;
31 r--;
32 }
33 return true;
34};

Callers 1

validPalindromeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected