aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-109/james-smith/perl/ch-1.pl8
1 files changed, 2 insertions, 6 deletions
diff --git a/challenge-109/james-smith/perl/ch-1.pl b/challenge-109/james-smith/perl/ch-1.pl
index df12634c3b..2c38afe0c4 100644
--- a/challenge-109/james-smith/perl/ch-1.pl
+++ b/challenge-109/james-smith/perl/ch-1.pl
@@ -15,12 +15,8 @@ done_testing();
sub my_function {
sub chowla {
- my ($n,$t) = ($_[0],0);
- return map( { $t+=$_ || () }
- map { ( $_ && !($n%$_) ) ? $_ : () }
- 2..($n-1)
- ),
- $t;
+ my ($t,$n) = (0,@_);
+ return ( map { (($n%$_) || ($t+=$_)) && () } 2..$n-1 ), $t;
}
}