Closed jdegand closed 3 months ago
In the even length section, right is not incremented or decremented.
right
left = i; right = i+1; while(left >=0 && right < str.length && str[left] === str[right]) { if(right-left+1 > longestSubstrLen) { longestSubstr = str.substring(left, right+1); longestSubstrLen = right-left+1; } left--; right;
@jdegand Thanks for the finding. I will fix it .
@jdegand Fixed.
In the even length section,
right
is not incremented or decremented.