Skip to content

Commit

Permalink
feat: initial solution for 2023 day 14
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAegis committed Dec 14, 2023
1 parent d3758ef commit 85b2fa4
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 22 deletions.
10 changes: 10 additions & 0 deletions resources/2023/14/example.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
O....#....
O.OO#....#
.....##...
OO.#O....O
.O.....O#.
O.#..O.#.#
..O..#O..O
.......O..
#....###..
#OO..#....
100 changes: 100 additions & 0 deletions resources/2023/14/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
..O.O....O...O...O...O.#O#.#.#O#O..#.#O....O...#..#O#...............#O..#.#..O..O.##.#O#..O...#.....
.#O.#.#O.##..O..#.......###...#.O#.##....#O#O.OO..##...#..O.O...#O.......O.O.OO##...#.##OOO.O.#..#.O
#.##..O.O.....#.OO....O#..OOO..OO..O....#..#...O..#..O..O.O#O.....O...O.#.O.O......O..OO..O...O...OO
O.....#.O...#....#.#O.#.O.........O...O..#.O.O...O#..O.OO......O.#O......O#.OO.#.##..OO.O#O.O.#.....
#O...#..........#..#......O..O..#......#O..OO...#O.O.............O..O.......#....O.OO#..OO#....O#.O.
##O.O.....OOO..OO..O...O.OO...#.O.O...#..O...OO...O..O.#OO.#........O........O.O....O...O...........
O..O...#.O.##.....OO.O#.......OO...OOO.#..#OO....#..O#...O.....O..O.#####..........O#..........O#...
OO......OO.O...#.#......#.#....OO###...O####OO..#...........##..O#O...#.........#..#....#OO.O.#....O
.##..O.#...O.#.O#..#.O.#...OO##O.....O.O.......O...........##...O....#OOO.....#...O.....O.O##.O###OO
O..O...O.O...O#O.OOOO.O.O......O#...O...#.#.......O#.O...#..#O.....#........O#...O..O..O.#.#.#O#OOO.
O#......#.#.O...OO#..#.#.#.O#.O#.......O#...O.O..O..........O........#.#O....#..OO..#..O..#.O..##...
OOO.#.OO.O..OO.OO..O....O...OO..#..#OO.O...#....#.OO.#..O.O#.O.#OO.O.....O......#.O..O#O...OO##.#...
.O#O..#OOOO#.O##.........OO#O#.#.O#..#..OO.....O.##.#..O.O....#...#..O....O.#.O#..O....O.O.....O.O..
..O#.OO..........#OO...O..O...#.####.#...#.......#####O.#.##..#O...O...O.....O......#.O.....O.......
.O........#.O.###OO..............#.......O...O.....OO#...#.O...#.O.O.O.O.......#.O..#O....##..#..O.#
.#.O#..#....O...#..O.#.O....O#......#...#...OO.O....#.O.O..#.......##OO..O.....OO...OO#...OO...###..
.#O.#.#...O.#..#.......#....#O.O.#....OO.O##.O.#..OO.O......##.....OO...O#..O.O.OO.#.O.O....#.......
O..O.OO.O.....O..O..#....O.......O.##O#...O.....O#OO#.....O..O.....O..#..O...............##.....#O..
....O..#OO#..#.#.O.#.#.OOO.OO#....OOO#....#.........O..O.#....#....OO.O.##...##O.O..#.O..#....O..O#.
#O.O.O.O.#O##...O..O##.O#....#......O...#.O..O.O....O.##O....O..#...O....##.#O.O#O...#.O#.#...O..O..
#..O.O..O##.O..O....O..OO#.OO........O#....O....O............O#.#.OO..#.#O.#....##.....OO..O...O...O
.O..OO.OOOO.#.#.O.#.O..O##....##O..##..O.#O.O#.#...#....#.....#OO..O#O......O........O...O........#.
...OO.O###.O.###.......#O#..O..#.#O...O#...O...O#..##..OO.O...O......O....#.#....OO.O.O#...OO...##O#
#..OO.....#.O.OOO.#...O.......O......#O...##...#O##..OO.#.O.........O.O...O...O..##...O..#..O#.....O
...O.#.#.O....##O...#O#...O....O..OO..#O.O....#O..#...O.OO.....OO.OOO.O.O.#.....OO#O.##..#..#.O#...O
..O#.O......##O#.OO..........#......#.OOOOO...#.O##......O...O.#OOO.O#O..#..O....#...O....#O..O.O...
...#...##O.O......#O...O#O...##OO.O......O..#O#..O.....#.OOO..#.O.O#..###.O....O.O.OOO....OO#O....#.
O#O..##..#O.#..........OO...O.O..###.O..O#.O.O.O.#.#.O.#.O...O.OO....#.#.....##..OOO#..OO......O#.##
O..O#O..#.#O.OO...#.OO.OO.##.O....#.....##O..O#..O.O.OO##.O#O.O#.O.#O..O.#.O....O#.#.O....#..OO....O
.O..##O#OO...O...O.....O....O.O.O........O........##O#OO.O.OO.O.##...##......O....#.O.O....O#.O...#.
.O.......#.#...O.....O...#........O#....O#.OO....#...O#.#O...#..##.#....##.OOO.#......#..O...OOO.#.O
......#O..##........##O#.......###.....O..OOO.......#.OO.#.....#...#.##.#..O......#O...O.O..O.....O.
.OOO#..#.....#.....#......O#O#....O.OOOO###.....O....OO.#O#...#.OO......O.O........#OO#.O..O........
#O#.#.OOO###...O..OO.O...#.#........#.#.#......OO#.....O...O....O.#....#..#..##.#.OOO#....#.#.O....O
#O#.#.##....#.O....##.....##.O.O.OO#.....#O...O#.....#..O.....#.#......#O..O...O.....#..O....#...#..
.O.......#.....O.O#.#.O.....##..#OO.#OO.O.O.#O.O.#O##OO.#..#O.O.....#......O#........#.#O...#.#.O...
#..O.##......O...O.O#..OO#...#..O..#OO.#O.O#....O#..#....O....O..#O..#.#......O...#..OO#....O.O....O
.#......#.#......#O............#OOO......#.OO..O#.O#.......#....#....##.O.......#...O.O#...O...#O..#
O...OO..O#......#.O........#.#....OO.#......O....O##..........O#..#....#O...O#.O..#....OOO..O....#O#
O...O...#.O.O.O.OOO..OO.##.O....O......#.#O...#...O...O#....O.#...#.......#.##....#.#.O.OOO..O...O.O
.#.O#...##O#.O..O....O.#.....#O.....#.O.....#...O#.O.O..#....O#OO..OOO..#O.OO.O...OO.OOO.#...##.O..#
........O#O#...#..OOO#...#O.O#..#.O.....O.OO.O#O..##.O.....O.#OO.........O.#OO.....OOO.....O.O.O.#..
.#....OO.#............O#..#.....OO....O.O.#..#...OO..#....#...#.#O....##..O....#O..#OO..O.....O....#
O..#.....O.O...O........O....#.#O...#......O....O......O......O..#.OO......#O...#..O.##......O#....O
...O.###..#...#.#..O.#.............#OO.#...#...##.#.O#.........O..##.##.#....O.....O.......O..O...O.
.O##....O...#....OO.##.#...O......OO..........#.O.......OO#.O.#..#.OO...#......OO#O.......#..#...#..
.#.O..#..#.OO.....O..O#.O..O....#.....O#O.OO.#.OOOO.##.O..O...O.O..#....O.....O.#...O.#...#.....O..#
.#.#O..#....#O..O.OO..O.....O....###..#...O.#....O#O...#....##...##.O.##..O...OOO.#..#O.....OOO#.O..
O..#O....#..............O.O.O..O.O.#..........O.....O#.O#.O..O.#.......O.OO...#.....##.#..O.#.#.#..#
#O..O..#.O.O..O#.OO....#O..#.....O..#..OO.#..##O.........#...O.#.....#..#.OO..O.##...#...#O.#O##..OO
#.........O...#..O.##O......#.O..##..#O..........#.#O#O........##....O....O....#..#...#O......O#.O.#
#.#..O.O.O.#.OO#.#..O....O#O.O.O.O..#....#..#.....#..O......O#...O.O.O....OOO##O.###.....O.O#.#..#.#
O...#OO..#...O..O..#..OOO.#....#..#.##...#..#....OO.O.O............#.#O#O#OO.OO...O.##O.##O#O....OOO
O..O.......O.#OO.O#........O###...O........O..#.O.OO.O...OO..OO.#O.O.#O.OO.O....OOO#.#.O.......O.O.O
#O..#O.......#..##.#....O.O#O#O.O#OO..O...O.O.O.OO.#..O#.......OO.O.##.O....O...#O......O....#O.O...
#..O........#..#..#O.OO##..OO...#..O#.O##....#.#.#.#...#....O.....O.....O...OO#O...#..O....#..##..O.
..O.....O.OOO#O....#.#.......#.OO....O.....OO#..O.O#.#.O...#...#..#.#OO..O.....#.O.....#...O...#.O#.
#.....#.....#O.#.O#O.O....#.....O#O#O#OO...O.....O#.........O..#....O.....O.......O.O#OO##....O#....
OO....#..O.#.O#....O#.O..#.#....#.#..#...#....#..OO......OO.O..###O....OOO.O..OOO#.#.O...#.OO.#..O#.
.##.#O...#......####......#...#..#.O.......O#..#.#...O#...O..O.........O##.#....O#OO..OO......O..##.
...O..#.O.O..#O..#O............#O#O..#.#...O..#......O..O...O##....#.#.............O..#...#......#..
#.#..#...##....#O....O.O.O.....#...#O..O.#..#.#O.O.#OOO.....#..#..#OO..O#........#.#.O..........O...
...#.O#......#...O...OO..#.#O.O..###O#O#...#.#..#....O#..O.#OO...#...O.##O...#.O..O#..#.O.#..#..OO..
...#....O...#.#.......OO#..OO.O..####.....##O.#...#.O....O......#......O#...#..#.O..O.OOO.O......#..
#..##..O..O....O..#O.O.O..O#.#.#..O..#.#...O.......OO#.OO...O..#.O#..O...OOO..O...O#..O....#....O...
.#.#...#.O.O..O..#..O........O....O#.#...O.O...#...O.O##O....#.#.O...#.O..#OOO..O.....#.O....##..##.
.......#OO..O..#.#....O.....O#.OO.O....O.........##.....OO......O...O#.....##..O#...#....OOO...##...
..#O...O.....O.O.##O..O.....O...O#O......#.........O..OO.....O.#.#OO..#....O.#...O..#.....#..O...O#.
.....O.O...#O.##.#O#..#.OO#.O..#O.O.#.OO.#OO...OO#O.##.O.#.O.##.#..#.#.............O.O.#.O..O..#...#
...O.#.....#.#.#..OO.O.O..#.O.....#.##......OO.#....OO.#.#O..#.O.....#.....##..O.#O#..OO.........#..
.O.#O.........#O....O.O....#.O.O..#.O#O..O.#.OO......O#....O#O.O.............O..#...O.OO#...O..O...O
.......#...#....#.....O......O.OO.O....O#.O...#....#...........#.O#..#..OOO.#O..#.O...O#..##.....O.#
........#....##...O..O.............#.O...O..#..#...O.##.#...O...#...#.O..#....###.#O.#.O.O..O....O.O
O.#....OOO..O.O.##.........O...O...OO#.....#O..OO..#.....#O..O#.O#.#O.#OO#...O#O....O...O...O......O
.O..........##.O.#..OO....#.O..........O.#....#.O...O.O.....OO.#..O...O....##...#OO..#...OO#.O#O.#..
O......O#O....#.##O.##OO.#....OO.....O.O.OO..O#.....#..OO.O..OO......#..O.OO..OO..O...#..O...#O.....
.###....O.....#O..#O....O.....#.OO..##....#.....O.#......#.....O##O...OO...O##O#....O#.........O#O#.
OO.#O##....#O.#...O........OO.....#..O...O..#.O#.#.#..OO#O.##.....#.....O.O....OO.....O.O....#...O#.
....O#OO..OO......#O.....#.O...OOO..OOO.#O....O..#.#.###..O..O..O#..........#..OOO...OO.O#O.#.#..#O.
O....#O.O.O.......#......O.......O.O...O...O....##O..O.OO#O....O.#............O..#O.##...O..........
O.......O....O##....#......OO..##.O....#O..##..O......O.O.......O#.#...###..#.....##..##.....O......
.O..O###O.........#.O.....OO..O.#.O.O...#O#.O.O..##..O..O...O..#...#O.#..#..O..#....O..O.O#.O#.O.OO.
..#.........O#..#OO......O.O#..O#.........O.#OOOO.....O..#O..#..#..OO.OO...OO...#..OO#...##..O...#..
..OO..#....O..O.O..OOO..#O#O##..#...O#O...#....O..O..#.O.OO..O.O......#O........#.....O.#...O#O...OO
..#......O##O.....OO...##......O...OO#....O..#OO#..#.O..O.#.......#..O.#.O#....#....#.OOO.#.....#...
..#.O.O.O.#....#.#.O.##.....#.O#.OO..OOO..O......O.........#....O..#..O.###.#..##O#...O#.O.O.O.#...#
#..O..O..#.#.O...#O#..O.....#O.O.....#............O..#.O#.....O....O..O.OO.O..#....OO.....###..#....
.O.O.#.....O#O##...#..#...#........#..O#.....O..#..O...O.#.....OO..O.#.##....OO#.#.....O..O....O.O..
........O..O.#..O#O...#........O.#O#...O#O##......O..#....#...O...O..O.O..##.OO....#.....#.O...#O...
.O.O..##O..O...OO...O..O.O#O...OOOO..O....O........O#...O..O#....O...O#OOO.O##....##..O.....OO.O#..#
.....#O.#..O......O...OO.O..#..#O....O....O....O#....O.O..O...#O.#....##......##..#..#O..#..OO...O.O
...#O.#.#..OO..O..........##..O#.#OO.......#...#O###.#O..O#O...O...#..O....O#O#O.#.....O.O.O#...O..#
##..#......O##..O.#...O....OOOO.....#....O.#...#.........#..O.#..O.....#...O...O.......O#......O#O..
.....O......O..##O#.....#O#...#O....O..O..O.......O#O##....OOOO..##...O.O#...OOOO...#OOOO##O..##....
#...O.O.O#..OOO...#O..O##.....#.#..#O...O###OO...O.OO.......O.O..#...###...........O..#....#.##...OO
O.OO......#....#........O#.#.#O.....#..........O#.#..##O...#..OO...#OO.#..O.#O..#........O.O..O#.O##
#.##...O.#.....OO...O..#.#.O.O.O.#.#O...#....#.#......#...#...#.O.#O#..#..O...#.OOO..#OO##..OO...#.#
O.....#.....#.O.O...O#.#...OO..OOO..O..O.O.#...O..#....O.#..OOO.O.O#O..OO#O..OO.O...O.........##.O..
..#....O........#.#O....O..#....O.###OO..#.#O.O..O.....###..OO.O..##...#.#..#O..O.....O.#.#O...O....
.O.OO..O#........O#..O..##...#O.......#..#.....#.........OO..#.O..OO#O..#....#OO......O............O
6 changes: 6 additions & 0 deletions solutions/typescript/2023/13/src/p1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
} from '@alexaegis/advent-of-code-lib';
import packageJson from '../package.json';

/**
* @deprecated use the one on the graph
*/
const getColumn = <T extends ToString = string, N extends GridGraphNode<T> = GridGraphNode<T>>(
gg: GridGraph<T, N>,
column: number,
Expand All @@ -23,6 +26,9 @@ const getColumn = <T extends ToString = string, N extends GridGraphNode<T> = Gri
: undefined;
};

/**
* @deprecated use the one on the graph
*/
const getRow = <T extends ToString = string, N extends GridGraphNode<T> = GridGraphNode<T>>(
gg: GridGraph<T, N>,
row: number,
Expand Down
5 changes: 0 additions & 5 deletions solutions/typescript/2023/14/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
"import": "./dist/p2.js",
"default": "./dist/p2.js"
},
"./parse": {
"types": "./src/parse.ts",
"import": "./dist/parse.js",
"default": "./dist/parse.js"
},
"./readme": "./readme.md"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions solutions/typescript/2023/14/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ describe('2023 14 p1', () => {
describe('the input', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).toEqual(0);
expect(p1(resources.input)).toEqual(109_661);
});
});

describe('example 1', () => {
it('should be solved', async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.1.txt');
expect(p1(resources.input)).toEqual(0);
expect(p1(resources.input)).toEqual(136);
});
});
});
25 changes: 22 additions & 3 deletions solutions/typescript/2023/14/src/p1.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { task } from '@alexaegis/advent-of-code-lib';
import packageJson from '../package.json';

export const p1 = (_input: string): number => {
return 0;
export const p1 = (input: string): number => {
const gg = input.toGridGraph();

const allNodes = gg.nodes.valueArray();
for (;;) {
const movable = allNodes.find((n) => n.value === 'O' && n.north?.to.value === '.');
if (movable === undefined) {
break;
}

movable.setValue('.');
movable.north?.to.setValue('O');
}

const aabb = gg.boundingBox();

return allNodes
.filter((n) => n.value === 'O')
.map((n) => aabb.height - n.coordinate.y)
.sum();
};

await task(p1, packageJson.aoc); // 0 ~0ms
await task(p1, packageJson.aoc); // 109661 ~0ms
16 changes: 15 additions & 1 deletion solutions/typescript/2023/14/src/p2.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { loadTaskResources } from '@alexaegis/advent-of-code-lib';
import { describe, expect, it } from 'vitest';
import packageJson from '../package.json';
import { p2 } from './p2.js';
import { findCycle, p2 } from './p2.js';

describe('2023 14 p2', () => {
describe('the input', () => {
Expand All @@ -17,4 +17,18 @@ describe('2023 14 p2', () => {
expect(p2(input)).toEqual(0);
});
});

describe('findCycle', () => {
it('should find a simple repeating pattern', () => {
const vals = [1, 2, 3, 4, 3, 4, 3, 4];
const cycle = findCycle(vals);
expect(cycle).toEqual([3, 4]);
});

it('should find a more complex repeating pattern', () => {
const vals = [1, 2, 3, 4, 4, 3, 4, 4, 3, 4, 4];
const cycle = findCycle(vals);
expect(cycle).toEqual([3, 4, 4]);
});
});
});
76 changes: 72 additions & 4 deletions solutions/typescript/2023/14/src/p2.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,76 @@
import { task } from '@alexaegis/advent-of-code-lib';
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Direction, GridGraphNode, task } from '@alexaegis/advent-of-code-lib';
import packageJson from '../package.json';

export const p2 = (_input: string): number => {
return 0;
const tilt = <T extends string = string, N extends GridGraphNode<T> = GridGraphNode<T>>(
allNodes: N[],
direction: Direction,
) => {
for (;;) {
const movable = allNodes.find(
(n) => n.value === 'O' && n.neighbours.get(direction)?.to.value === '.',
);
if (movable === undefined) {
break;
}

movable.setValue('.' as T);
movable.neighbours.get(direction)?.to.setValue('O' as T);
}
};

const cycle = <T extends string = string, N extends GridGraphNode<T> = GridGraphNode<T>>(
allNodes: N[],
) => {
for (const cardinalDirection of Direction.cardinalDirections) {
tilt<T>(allNodes, cardinalDirection);
}
};

export const findCycle = <T>(values: T[]): T[] | undefined => {
let cycle: T[] | undefined;
for (let cs = 1; cs < values.length / 2; cs++) {
const possibleCycle = values.slice(values.length - cs);

if (possibleCycle.every((v, i) => values[values.length - i - cs * 2] === v)) {
cycle = possibleCycle;
}
}

return cycle;
};

export const p2 = (input: string): number => {
const gg = input.toGridGraph<string>();

const allNodes = gg.nodes.valueArray();

gg.print();
console.log('----------------');
const cc = 10;
// const hashes = [gg.toString()];

for (let i = 0; i < cc; i++) {
// console.log('----------------');
cycle(allNodes);
// hashes.push(gg.toString());
// const possibleCycle = findCycle(hashes);
// if (possibleCycle) {
// console.log('CYCLE FOUND!', possibleCycle.length);
// break;
// }
//gg.print();

if (i % 10_000 === 0) {
console.log((i / cc) * 100);
}
}
gg.print();
const aabb = gg.boundingBox();
return allNodes
.filter((n) => n.value === 'O')
.map((n) => aabb.height - n.coordinate.y)
.sum();
};

await task(p2, packageJson.aoc); // 0 ~0ms
await task(p2, packageJson.aoc); // 109661 ~0ms
12 changes: 8 additions & 4 deletions solutions/typescript/libs/lib/src/array/array.polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ declare global {
unique(comparator?: (a: T, b: T) => boolean): T[];
pairsWith<N = T>(other?: N[], onlyUnique?: boolean): [T, N][];
getSizedGroups(groupSize: number): T[][];
findLast<V extends T>(predicate: (t: T) => t is V): V | undefined;
findLast<V extends T>(
predicate: (t: T, i: number) => boolean,
skipCount?: number,
): V | undefined;
mapFirst<V>(map: (t: T) => V): V | undefined;
mapLast<V>(map: (t: T) => V): V | undefined;
zip<U>(other: U[]): [T, U][];
Expand Down Expand Up @@ -118,11 +121,12 @@ Array.prototype.clear = function (): void {
this.splice(0);
};

Array.prototype.findLast = function <T, V extends T>(
Array.prototype.findLast = function <T>(
this: T[],
predicate: (t: T) => t is V,
predicate: (t: T, i: number) => boolean,
skipCount: number,
): T | undefined {
return findLast(this, predicate);
return findLast(this, predicate, skipCount);
};

Array.prototype.pairs = function <T>(): [T, T][] {
Expand Down
10 changes: 7 additions & 3 deletions solutions/typescript/libs/lib/src/array/find-last.function.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export const findLast = <T>(array: T[], predicate: (t: T) => boolean): T | undefined => {
for (let i = array.length - 1; i >= 0; i--) {
if (predicate(array[i] as T)) {
export const findLast = <T>(
array: T[],
predicate: (t: T, i: number) => boolean,
skipCount = 0,
): T | undefined => {
for (let i = array.length - 1 - skipCount; i >= 0; i--) {
if (predicate(array[i] as T, i)) {
return array[i];
}
}
Expand Down
44 changes: 44 additions & 0 deletions solutions/typescript/libs/lib/src/model/graph/graph.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,50 @@ export class Graph<
);
}

/**
* TODO: Fix
* Swap 2 nodes with all their neighbours, but keep the value
*/
public swap(a: N, b: N): void {
const an = a.neighbours.entryArray();
const bn = b.neighbours.entryArray();
const ak = this.nodes.findKey(a);
const bk = this.nodes.findKey(b);

if (ak === undefined || bk === undefined) {
throw new Error('trying to swap nodes without keys');
}

a.neighbours.clear();
b.neighbours.clear();

this.nodes.set(ak, b);
this.nodes.set(bk, a);
for (const [d, n] of bn) {
this.edges.delete(n);
const edge = {
...n,
from: a,
to: n.to === a ? b : n.to,
};
a.neighbours.set(d, edge);
this.edges.add(edge);
}

for (const [d, n] of an) {
this.edges.delete(n);
const edge = {
...n,
from: b,
to: n.to === b ? a : n.to,
};
a.neighbours.set(d, edge);
this.edges.add(edge);
}

a;
}

private tryAddNode(value: T, key?: string): [string, N] {
let existing: [string, N] | undefined;
if (key) {
Expand Down
Loading

0 comments on commit 85b2fa4

Please sign in to comment.