aboutsummaryrefslogtreecommitdiff
path: root/challenge-115/arne-sommer/raku/largest-multiple
blob: 5abea60e994fb8c1ef9036c57c39398f85c8ef8f (plain)
1
2
3
4
5
6
7
8
9
#! /usr/bin/env raku

unit sub MAIN (*@N where @N.elems > 0 && all(@N) == any(0..9), :v(:$verbose));

my @all = @N.permutations>>.join.grep(* ~~ / <[02468]> $/).sort.reverse;

say ": { @all.join(", ") }" if $verbose && @all;

say @all[0] if @all[0] && @all[0] != 0;