1
var maxUniqueSplit = function (s) {
2
let wordSet = new Set(),
3
res = 1;
4

5
function checkUniqueSubstring(i) {
6
if (i === s.length) {
7
res = Math.max(wordSet.size, res);
8
return;
9
}
10

11
for (let j = i + 1; j <= s.length; j++) {
12
let str = s.substring(i, j);
13
if (!wordSet.has(str)) {
14
wordSet.add(str);
15
checkUniqueSubstring(j);
16
wordSet.delete(str);
17
}
18
}
19
}
20

21
checkUniqueSubstring(0);
22

23
return res;
24
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0