题解 | #回文字符串#

回文字符串

https://www.nowcoder.com/practice/84424799af474ba093b06c29a1f12dfb

const _isPalindrome = string => {
                // 补全代码
                let str=string.split('')
                while(str.length>1){
                    if(str.pop()!=str.shift()){
                        return false
                    }
                }
                return true
            }

全部评论

相关推荐

头像
不愿透露姓名的神秘牛友
06-08 12:16
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务