Skip to content

Commit 1088b63

Browse files
committed
1593
1 parent 08bdb17 commit 1088b63

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Oct-21-24.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def maxUniqueSplit(self, s: str) -> int:
3+
def bt(i=0,seen=set()):
4+
if i==len(s):
5+
return 0
6+
ans = 0
7+
for j in range(i+1,len(s)+1):
8+
if s[i:j] not in seen:
9+
seen.add(s[i:j])
10+
ans = max(ans,1+bt(j,seen))
11+
seen.remove(s[i:j])
12+
return ans
13+
return bt()

0 commit comments

Comments
 (0)