# | 标题 | 回答 | 解析 | 创建时间 |
---|---|---|---|---|
1 | 最少需要多少只小白鼠能找出有毒的试剂? | 10 | Mar 23, 2019, 10:59:12 PM | |
2 | 在网络安全中,“拒绝服务攻击”是指( )。 | A | 拒绝服务攻击即是攻击者想办法让目标机器停止提供服务 | Mar 23, 2019, 10:56:53 PM |
3 | 无重复字符的最长子串 |
function test(str, maxlength) { const a = str[0]; const arr1=[]; const arr2=[]; arr2.push(a); for(let i = 1; i < str.length; i++){ arr1[i-1] = str[i]; } if(arr1.length === 0) { console.log(maxlength); } for(let i = 0; i< arr1.length; i++) { if (arr2.includes(arr1[i])) { if(arr2.length > maxlength){ test(arr1.join(''), arr2.length); } else { test(arr1.join(''), maxlength); } break; } else { arr2.push(arr1[i]); } if (i === arr1.length - 1) { maxlength = maxlength > arr1.length + 1 ? maxlength : arr1.length + 1; console.log(maxlength) } } } test('abbcddefghijiklm', 0) | Mar 23, 2019, 10:27:59 PM | |
4 | 下面关于归并排序的说法错误的有() | C | Mar 23, 2019, 3:46:13 PM | |
5 | 年龄问题求解 | 0,0,0 | Mar 23, 2019, 3:40:26 PM | |
6 | 下列选项中哪些属性是CSS3新增的? | A,B,D | Mar 23, 2019, 3:35:37 PM | |
7 | 今天是星期几? | D是对的,今天星期日 | Mar 23, 2019, 3:16:26 PM | |
8 | 两数之和 | function test(target, nums, item = 0) { const a = nums[item]; const newarr = []; for(let i = item + 1; i< nums.length; i++) { newarr[i-1-item] = nums[i]; } for(let j = 0; j < newarr.length; j++) { if (target === a + newarr[j]) { console.log(item, item+j+1); break; } else { if (j === newarr.length-1) { test(target, nums, item+1); } } } } test(9, [2,7,8,9],0) | item为数组下标 | Mar 23, 2019, 3:02:04 PM |