题解 | #回文字符串#

回文字符串

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;
            }

全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 11:16
点赞 评论 收藏
分享
点赞 评论 收藏
分享
墨西哥大灰狼:如果你的校友卤馆还在的话,他肯定会给你建议的,可是卤馆注销了@ 程序员卤馆
点赞 评论 收藏
分享
这不纯纯作弊了吗😢😢😢
编程界菜鸡:信这个的这辈子有了,这智商你靠啥都没用
你找工作的时候用AI吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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