题解 | #回文字符串#

回文字符串

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

{"html":"<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <meta charset=utf-8>\r\n    </head>\r\n    <body>\r\n    \t\r\n        <script type=\"text/javascript\">\r\n            const _isPalindrome = str => {\r\n                // 补全代码\r\n                let min = 0\r\n    let max = str.length - 1\r\n    console.log(max, str[max] === str[min])\r\n    let flag = false\r\n    while (min <= max) {\r\n        if (str[min] === str[max]) {\r\n            flag = true\r\n        } else {\r\n            flag = false\r\n        }\r\n        min++\r\n        max--\r\n    }\r\n    return flag\r\n            }\r\n        </script>\r\n    </body>\r\n</html>","css":"/* html, body {\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\tmargin: 0;\\n\\tpadding: 0;\\n} */","js":"// 请在这里输入代码"}

全部评论
let min = 0 let max = str.length - 1 console.log(max, str[max] === str[min]) let flag = false while (min <= max) { if (str[min] === str[max]) { flag = true } else { flag = false } min++ max-- } return flag
点赞 回复 分享
发布于 2023-11-21 15:44 浙江

相关推荐

强大的马里奥:不太可能,我校计算机硕士就业率99%
点赞 评论 收藏
分享
05-12 11:09
已编辑
门头沟学院 后端
已注销:没必要放这么多专业技能的描述。这些应该是默认已会的,写这么多行感觉在凑内容。项目这块感觉再包装包装吧,换个名字,虽然大家的项目基本都是网上套壳的,但是你这也太明显了。放一个业务项目,再放一个技术项目。技术项目,例如中间件的一些扩展和尝试。
简历中的项目经历要怎么写
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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