Using PHP, a pre-fill reference array of iterators, a robust old tech for loop, ascending sorting of values, and the most occurrence is the first key since `asort()` does maintains key association. ``` #!/usr/bin/php -d memory_limit=-1 <?php $time_start = microtime(true); // Benchmark $list = file("1M_random_numbers.txt"); $count = count($list); $temp = array_fill(0, $count, 0); for ($i = 0; $i < $count; $i++){ $temp[(int)$list[$i]] = $temp[(int)$list[$i]] + 1; } asort($temp); echo "Most occurrence value : " . array_key_first($temp) . PHP_EOL; echo "Repeat count : " . $temp[0] . PHP_EOL; $time_end = microtime(true); // Benchmark $time = $time_end - $time_start; // Benchmark echo "Runtime $time second(s)\n"; // Benchmark ``` Results on my machine and PHP 8.4: ``` Most occurrence value : 1000 Repeat count : 1045 Runtime 0.25868082046509 second(s) ```