diff options
| author | drbaggy <js5@sanger.ac.uk> | 2021-04-26 09:15:20 +0100 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2021-04-26 09:15:20 +0100 |
| commit | 03f28cae3ddea3b08a671dd3f20f3d32777aa4db (patch) | |
| tree | 7aea1f86e706cf8233d89d704ac2342a0c63d059 /challenge-109/brtastic/php/ch-1.php | |
| parent | 46b8aecc9397c6211a1e97a7f0638833726294a2 (diff) | |
| parent | 1ff197d81f941c3dd35d77bec8a0326807e8d2b1 (diff) | |
| download | perlweeklychallenge-club-03f28cae3ddea3b08a671dd3f20f3d32777aa4db.tar.gz perlweeklychallenge-club-03f28cae3ddea3b08a671dd3f20f3d32777aa4db.tar.bz2 perlweeklychallenge-club-03f28cae3ddea3b08a671dd3f20f3d32777aa4db.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-109/brtastic/php/ch-1.php')
| -rw-r--r-- | challenge-109/brtastic/php/ch-1.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/challenge-109/brtastic/php/ch-1.php b/challenge-109/brtastic/php/ch-1.php new file mode 100644 index 0000000000..cc5c5e6de3 --- /dev/null +++ b/challenge-109/brtastic/php/ch-1.php @@ -0,0 +1,8 @@ +<?php + +foreach(range(1, 20) as $num) { + echo array_sum(array_filter( + $num >= 4 ? range(2, floor($num / 2)) : [], + fn ($divisor) => $num % $divisor == 0 + )) . "\n"; +} |
