摘要: 1. 最长无重复子串的长度:滑动窗口思想 点击查看代码 // 滑动窗口思想 function findLongString(string = ''){ let box = '';// 1. 暂存子串 【窗口】 let lastIndex = 0;// 2. 最长子串时的结束索引 let longLe 阅读全文
posted @ 2021-06-27 21:42 惊沙男孩 阅读(41) 评论(0) 推荐(0)
摘要: 1. 利用Set对象 缺点:不能去重对象{} 点击查看代码 let arr = [2,3,1,5,34,90,34,23]; let b = [...new Set(arr)]; // let b = Array.from(new Set(arr)); console.log(b); 2. 利用re 阅读全文
posted @ 2021-06-27 18:20 惊沙男孩 阅读(109) 评论(0) 推荐(0)