- or download this
> say [+] grep {$_ %% 5 or $_ %% 3}, 1..10;
33
- or download this
> sub sum3_5 (Int $max) { return [+] grep {$_ %% 5 or $_ %% 3}, 1..$ma
+x};
sub sum3_5 (Int $max) { #`(Sub|320422744) ... }
> say sum3_5 10;
33
- or download this
> say reduce {$^a + $^b}, grep {$_ %% 5 or $_ %% 3}, 1..10;
33
- or download this
> say reduce * + *, grep {$_ %% 5 or $_ %% 3}, 1..10;
33