Rafraîchissoir

By Shahed Nooshmand

Perl Weekly Challenge: week 67

This may be the shortest it’ll ever be.

Task #1

You are given two integers $m and $n. Write a script print all possible combinations of $n numbers from the list 1 2 3 … $m.

Sure:

raku -e '(1..$m).combinations($n).say'

Task #2

Remember telephone keypads?

raku -e "say [X~] [|('a'..'o').rotor(3), <p q r s>, <t u v>, <w x y z>][35.comb.map(*-2)]"

It’s really just a bunch of brackets.