I need to find all permutations of a list satisfying a condition but I'm lost about how to do so. Given a list I want a write a function to produce all permutations such that the list is "top aligned" and has all permutations of the elements. I think the second requirement of having all permutations of the elements is straightforward using replacements, but I'm not sure how to do the first. Here I give two examples of what I want the output to look like (I used Grid
only to increase the clarity of the output)
MyPermute[{{"a","b"}}]=
MyPermute[{{"a","b","c"}}]=
EDIT:
I think the above two examples are insufficient to fully specify the output I want. If the permutation function was run on four elements I'd want to include output such as:
{{a},{a,b},{c}}
, i.e. the length of rows not decreasing? $\endgroup$