Let's say I want all permutations of 2 letters out of a, b and c.
I can do:
my @perm = <a b c>.combinations(2)?.permutations;
say @perm;
# [((a b) (b a)) ((a c) (c a)) ((b c) (c b))]
which is close, but not exactly what I need.
How do I “flatten” this so that I get:
# [(a b) (b a) (a c) (c a) (b c) (c b)]
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…