题解 | #回文字符串#

回文字符串

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

   const _isPalindrome = string => {
                // 补全代码
                let left = 0;
                let right = string.length-1;
                let strL = null;
                let strR = null;
                while(left<=right){
                     strL = string[left];
                     strR = string[right];
                    if(strL!==strR){
                        return false;
                    }else{
                        left++;
                        right--;
                    }
                }
                return true;
            }

全部评论

相关推荐

见见123:简历没有啥问题,是这个社会有问题。因为你刚毕业,没有工作经历,现在企业都不要没有工作经历的。社会病了。
点赞 评论 收藏
分享
Yki_:你要算时间成本呀,研究生两三年,博士三四年,加起来就五六年了,如果你本科去腾讯干五年,多领五年的年薪,加上公司内涨薪,可能到时候十五年总薪资也跟博士差不多
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务