From 4747b0cdc60b7ff3cd92f5a20a97f20baf509479 Mon Sep 17 00:00:00 2001 From: kodenook Date: Wed, 4 Oct 2023 15:55:04 -0300 Subject: [PATCH] Reto #21 - php Reto #21 fue resuelto en php. --- .../php/kodenook.php" | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 "Retos/Reto #21 - N\303\232MEROS PRIMOS GEMELOS [Media]/php/kodenook.php" diff --git "a/Retos/Reto #21 - N\303\232MEROS PRIMOS GEMELOS [Media]/php/kodenook.php" "b/Retos/Reto #21 - N\303\232MEROS PRIMOS GEMELOS [Media]/php/kodenook.php" new file mode 100644 index 0000000000..efcee95f7f --- /dev/null +++ "b/Retos/Reto #21 - N\303\232MEROS PRIMOS GEMELOS [Media]/php/kodenook.php" @@ -0,0 +1,64 @@ += count($numbers)) { + continue; + } + + if ($numbers[$i + 1] - $numbers[$i] === 2) { + $response .= '(' . $numbers[$i] . ',' . $numbers[$i + 1] . ') '; + } + } + + return $response; +} + +echo primeTwins(14) . PHP_EOL; +echo primeTwins(7) . PHP_EOL; +echo primeTwins(2) . PHP_EOL;