12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import { StarMap } from "./11_common.ts";
- import { LoadInput } from "../common.ts";
- async function main() {
- const tests = [
- '...#......',
- '.......#..',
- '#.........',
- '..........',
- '......#...',
- '.#........',
- '.........#',
- '..........',
- '.......#..',
- '#...#.....'
- ];
- const test_reddit_1 = [
- "...#......#....",
- "...............",
- "#..........#...",
- "...............",
- "...............",
- "...............",
- "......#.....#..",
- ".#.............",
- "#..............",
- "...............",
- "...............",
- "...............",
- "......#.#......",
- "............#..",
- "....#..........",
- ];
- const test_reddit_2 = [
- "......#........",
- ".........#.....",
- "...............",
- "...............",
- "..........#...#",
- "...............",
- "...............",
- "#...#..........",
- "..#............",
- "...............",
- ".........#.....",
- ".........#.....",
- "...........#...",
- "...............",
- ".#...........#.",
- ];
- const input = await LoadInput(11);
- const sm = new StarMap(input, 1_000_000);
-
- console.log(`The sum of the shortest paths between galaxies is: ${sm.solvePart1()}`);
- }
- main();
|