题解 | #回文字符串#
回文字符串
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":"// 请在这里输入代码"}