Closed jakobkogler closed 9 years ago
Seems like a reasonable thing to add. I'm not sure about the last one, what should happen when called on numbers. Another reasonable alternative is the integer partition function: https://en.wikipedia.org/wiki/Partition_%28number_theory%29
Are you still planning on implementing this, or should I?
Sorry for the delay, I will implement it right now.
No worries, take your time.
Can be closed now. Implemented in #104
Because of this PPCG question.
How about a function, that returns all partitions of a string? By partition I mean the following:
So the elements should stay in order. It simply splits the string in all possible ways. Is there a special name for this kind of partitions?
The same thing should also work on sequences, like a list. And on numbers, where the number get's converted into a string, the partitions are computed and then mapped onto strings.
I can implement this in the next days. Just post it here to see, what you think about this. This functionality is quite specific, but I have seen could also be useful for other questions like this. And I currently don't see a nice way to implement such a thing in Pyth right now. The only thing that cames to mind is something similar like in this answer, which is really really long.