diff --git a/raindrops.php b/raindrops.php index 519b64d..b3abd44 100644 --- a/raindrops.php +++ b/raindrops.php @@ -1,13 +1,15 @@ 'Pling', 5 => 'Plang', 7 => 'Plong']; + $response = ''; + foreach ($raindrops as $factor => $raindrop) { + if ($num % $factor == 0) { + $response .= $raindrop; + } +} + + return $response ?: (string) $num; }