题解 | #回文字符串#

回文字符串

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 = string => {\r\n                // 补全代码\r\n                let arr = string.split(\"\");\r\n                let len = Math.floor(arr.length / 2);\r\n                let res = true;\r\n                for(let i = 0;i<len;i++){\r\n                    if(arr[i] !== arr[arr.length - 1 - i]){\r\n                        res = false;\r\n                        break;\r\n                    }\r\n                }\r\n                return res;\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":"// 请在这里输入代码"}

#题解#
全部评论

相关推荐

哈哈哈,你是老六:百度去年裁员分评不好,赶紧弄点红包
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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