I want to find all possible partitions of a str without empty strs and must contain ever char (should not contain the original str)
For example:
s = '1234'
partitions(s) # -> [['1', '2', '3', '4'], ['1', '2', '34'], ['1', '23', '4']
# ['12', '3', '4'], ['12', '34'], ['1', '234'], ['123', '4']]
# should not contain ['1234']
EDIT: Can be in any order
Why My Question Is Not a Duplicate:
I don't want permutations that is:
from itertools import permutations
s = '1234'
permutations(s) # returns ['1', '2', '3', '4'], ['1', '2', '4', '3']...
But I want the the string partitioned into many lengths (Please Have a Look at the First Code)
Thanks!