File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,17 @@ export const solvePart2 = (input: string) => {
55
55
const deltaBtoA = subtractCoordinates ( a , b ) ;
56
56
57
57
// go from a -> b
58
- let currentPosition = b ;
58
+ let currentPosition = a ;
59
59
while ( board . isWithinBounds ( currentPosition ) ) {
60
60
possibleAntiNodes . add ( currentPosition ) ;
61
- currentPosition = addCoordinates ( currentPosition , deltaBtoA ) ;
61
+ currentPosition = addCoordinates ( currentPosition , deltaAtoB ) ;
62
62
}
63
63
64
64
// go from b -> a
65
- currentPosition = a ;
65
+ currentPosition = b ;
66
66
while ( board . isWithinBounds ( currentPosition ) ) {
67
67
possibleAntiNodes . add ( currentPosition ) ;
68
- currentPosition = addCoordinates ( currentPosition , deltaAtoB ) ;
68
+ currentPosition = addCoordinates ( currentPosition , deltaBtoA ) ;
69
69
}
70
70
} , board . getPositionsByKey ( char ) ) ;
71
71
}
You can’t perform that action at this time.
0 commit comments