字符串出现的不重复最长长度
function maxRepeat(s){
let list=Array.from(s);
let map=new Map();
let max=0;
for(let i=0;i<list.length;i++){
if(map.has(list[i])){
map.set(list[i],map.get(list[i])+1);
}else{
map.set(list[i],1);
}
if(map.get(list[i])>max){
max=map.get(list[i]);
}
}
return max;
}
console.log(maxRepeat("aaabbbbccccc"));