题解 | #回文字符串#
回文字符串
https://www.nowcoder.com/practice/84424799af474ba093b06c29a1f12dfb
}else{ len=Math.floor(string.length/2) console.log(len) let left=len-1 let right=len+1 while(string[left]===string[right] && string[left]){ if(left===0){ console.log('true') return true } left-- right++ } console.log('false') return false } }