11 lines
271 B
PHP
11 lines
271 B
PHP
<?php
|
|
|
|
$numbers = array_map('intval', explode("\n", file_get_contents('input.txt')));
|
|
|
|
foreach ($numbers as $number) {
|
|
$number_to_2020 = 2020 - $number;
|
|
if (in_array($number_to_2020, $numbers, true)) {
|
|
echo $number_to_2020 * $number;
|
|
exit;
|
|
}
|
|
} |