1class Solution {2int max = 0;34public int maxUniqueSplit(String s) {5int n = s.length();6backtrack(s, 0, new HashSet<String>());7return max;8}910public void backtrack(String s, int start, Set<String> h) {11if (start == s.length()) {12max = Math.max(max, h.size());13}14String res = "";1516for (int i = start; i < s.length(); i++) {17res += s.charAt(i);18if (h.contains(res)) continue;19h.add(res);20backtrack(s, i + 1, h);21h.remove(res);22}23}24}