1var maxUniqueSplit = function (s) {2let wordSet = new Set(),3res = 1;45function checkUniqueSubstring(i) {6if (i === s.length) {7res = Math.max(wordSet.size, res);8return;9}1011for (let j = i + 1; j <= s.length; j++) {12let str = s.substring(i, j);13if (!wordSet.has(str)) {14wordSet.add(str);15checkUniqueSubstring(j);16wordSet.delete(str);17}18}19}2021checkUniqueSubstring(0);2223return res;24};