let uniqueSubString = ""
for (let i = 0; i < s.length; i++) {
let substring = s
for (let j = i + 1; j < s.length; j++) {
if (substring.includes(s[j])) {
break
} else {
substring += s[j]
}
}
if (uniqueSubString.length < substring.length) {
uniqueSubString = substring
}
}
return uniqueSubString.length
};
< /code>
Runtime Error
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
Line 44: Char 17 in deserializer.js (deserializer.toString)
Line 32: Char 36 in solution.js (Object.)
Line 16: Char 8 in runner.js (Object.runner)
Line 24: Char 26 in solution.js (Object.)
at Module._compile (node:internal/modules/cjs/loader
at Module._extensions..js (node:internal/modules/cjs/loader
at Module.load (node:internal/modules/cjs/loader
at Module._load (node:internal/modules/cjs/loader
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
Node.js v20.10.0
< /code>
get this error when running in leetcode. in other compilers it work accurately.
it works and provide right output for all compiler but when try to run in leetcode it gets the error