const getLengthOfStr = str => {
let arr = [];
let maxLength = 0;
let alphabet = “”;
for (let j = 0; j < str.length; j++) {
for (let i = j; i<str.length; i++) {
alphabet = str.charAt(i);
if (arr.includes(alphabet)) {
if(maxLength < arr.length) {
maxLength = arr.length;
console.log(maxLength)
}
arr = [];
break;
} else {
arr.push(alphabet);
console.log(arr)
}
}
}
return maxLength;
}
console.log(getLengthOfStr(“abcadebfg”))
> module.exports = { getLengthOfStr };```