Skip to content

Commit 5f8c099

Browse files
author
grondilu
committed
Update grondilu-mmch.pl
style
1 parent 7168248 commit 5f8c099

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rosalind/grondilu-mmch.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use v6;
22

3-
my $rna = lines[1..*-1].join;
4-
my $bag = $rna.comb.bag;
5-
63
sub C($k, $n) {
74
if $k < 0 or $k > $n { return 0 }
85
elsif $k < 2 { return $n }
@@ -14,6 +11,9 @@ ($k, $n)
1411

1512
sub postfix:<!>(Int $n) { [*] 1 .. $n }
1613

17-
say
18-
C($bag<A U>.min, $bag<A U>.max) * $bag<A U>.min! *
19-
C($bag<C G>.min, $bag<C G>.max) * $bag<C G>.min!;
14+
my $rna = lines[1..*-1].join;
15+
given $rna.comb.bag {
16+
say
17+
C(.<A U>.min, .<A U>.max) * .<A U>.min! *
18+
C(.<C G>.min, .<C G>.max) * .<C G>.min!;
19+
}

0 commit comments

Comments
 (0)