Day 15 part2 correct answer
This commit is contained in:
@@ -11,12 +11,9 @@ for ($i = 0; $i < 5; $i++) {
|
|||||||
if ($newNumber > 9) {
|
if ($newNumber > 9) {
|
||||||
$newNumber++;
|
$newNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newInput[count($input) * $i + $row][count($input[0]) * $j + $column] = $newNumber%10;
|
$newInput[count($input) * $i + $row][count($input[0]) * $j + $column] = $newNumber%10;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// echo "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$input = $newInput;
|
$input = $newInput;
|
||||||
@@ -52,4 +49,4 @@ while (count($queue) > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $visited[count($visited) - 1][count($visited[0]) - 1]; //553
|
echo $visited[count($visited) - 1][count($visited[0]) - 1]; //2858
|
||||||
|
|||||||
Reference in New Issue
Block a user