positive integer but smallest from given array 2
Never
function solution($data) { /* pengurutan */ sort($data); /* buat value jadi unique */ $unique_data = array_unique($data); /* key di $unique_data harus di perbaiki */ $new_data = array(); foreach ($unique_data as $v) { $new_data[] = $v; } /* cari integer paling kecil tapi ga ada di $new_data */ $key = 0; $output = NULL; for($i=1;$i<=100000;$i++) { if ($new_data[$key] == $i) { $key++; continue; } $output = $i; break; } return $output; } $x = [-1,-3]; echo solution($x) . "<br>"; $x = [1,2,3]; echo solution($x) . "<br>"; $x = [1,3,6,4,1,2]; echo solution($x) . "<br>";
Raw Text
-
(ANAL) - O MELHOR CU DO BRASIL, É DA SUZY SILVA!
8 min ago
-
dsgasdasfgfsa
10 min ago
-
What Oem Keto Gummies Experts Don't Want You To Know
15 min ago
-
Quick Books Customers Support
33 min ago
-
LETSDOEIT - Alina Lopez And Gia Milana Share A Cock And Get Cum All Over Their Asses
37 min ago
-
FUCKING♥️😏 SLEEPING💤 LITTLE GIRL🍼👧
39 min ago
-
Pedowoman boy
50 min ago
-
10 Reasons Bioxtrim Keto Gummies Uk Is A Waste Of Time
52 min ago
-
NEW CH.1.L.D D000D
53 min ago
-
FAMILY SINNERS - Naughty Babe Demi Hawks Finally Gets In Her Hot Step Uncle Derrick Pierce's Pa
1 hour ago