Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def all_partition(curPart, start, n, str):
- if (start >= n):
- allPart.append(curPart)
- print (allPart)
- i = start
- while i < n:
- str1 = str[start : i+1]
- curPart.append(str1)
- if(len(allPart) > 0):
- allPart.pop()
- all_partition(curPart, i+1, n, str)
- curPart.pop()
- i = i + 1
- curPart = []
- allPart = []
- str = "abcd"
- n = len(str)
- all_partition(curPart, 0, n, str)
- print(test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement