摘要:
‘abc’的全排列等于 ('a'拼接上'bc'的全排列数组中的每一项) + ('b'拼接上'ac'的全排列数组的每一项) + ('c'拼接上'ab'的全排列数组的每一项) 思路copy from 牛客网的用户 const _permute = string => { // 补全代码 if (stri 阅读全文
posted @ 2022-01-11 23:45
黄燃
阅读(339)
评论(0)
推荐(0)
摘要:
function testUrl(url) { let pattern = /^http(s)?:\/\/[\w-]+(\.[\w-]+)+(\:\d+)?(\/\w+)*(\?\w+=.*(\&\w+=.*)*)?$/i; return pattern.test(url); } 阅读全文
posted @ 2022-01-11 22:37
黄燃
阅读(661)
评论(0)
推荐(0)
摘要:
方法一: Array.prototype.uniq = function () { let arr = []; this.forEach((item, index, array) => { const result = arr.some((x) => Object.is(x, item)); if 阅读全文
posted @ 2022-01-11 02:40
黄燃
阅读(124)
评论(0)
推荐(0)