1 2 3 4 5 6 7 8 9 10 11 12
my @L = (0, 1, 2, 5); my $X = 2; my $Y = 21; .say for ( |@L xx $X ) .combinations( $X ) .map( *.join.Int ) .grep( * < $Y ) .grep( *.chars == $X ) .unique .sort ;