题解 | #无重复数组#

无重复数组

https://www.nowcoder.com/practice/d2fa3632268b41df9bc417b74802ad8c?tpId=271&tqId=39547&rp=1&ru=/exam/company&qru=/exam/company&sourceUrl=%2Fexam%2Fcompany&difficulty=undefined&judgeStatus=undefined&tags=&title=

{"html":"<!DOCTYPE html>\r\n<html lang=\"en\">\r\n    <head>\r\n        <meta charset=\"UTF-8\">\r\n    </head>\r\n    <body>\r\n\r\n        <script>\r\n            const _getUniqueNums = (start,end,n) => {\r\n                // 补全代码\r\n                let arr = [];\r\n                while(n){\r\n                    let item = Math.ceil(Math.random()*8+2)\r\n                    if(!arr.includes(item)){\r\n                        arr.push(item);\r\n                        n--;\r\n                    }\r\n                }\r\n                return arr\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":"// 请在这里输入代码"}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-24 18:34
点赞 评论 收藏
分享
06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
07-23 18:25
河北大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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