aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-113/cheok-yin-fung/perl/ch-1.pl14
1 files changed, 2 insertions, 12 deletions
diff --git a/challenge-113/cheok-yin-fung/perl/ch-1.pl b/challenge-113/cheok-yin-fung/perl/ch-1.pl
index 6197890686..b037a62544 100644
--- a/challenge-113/cheok-yin-fung/perl/ch-1.pl
+++ b/challenge-113/cheok-yin-fung/perl/ch-1.pl
@@ -34,21 +34,11 @@ sub representable {
return 0 if $D == 2 || $D == 5;
if ($D == 4 && $N > 10) {
- if ($N % 2 == 0) {
- return 1;
- }
- else {
- return 0;
- }
+ return $N % 2 == 0 ? 1 : 0;
}
if ($D == 8 && $N >= 40) {
- if ($N % 2 == 0) {
- return 1;
- }
- else {
- return 0;
- }
+ return $N % 2 == 0 ? 1 : 0;
}
if ($D == 6) {