We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f10131 commit a2273b7Copy full SHA for a2273b7
src/_PathFinder_/AStar/index.js
@@ -11,7 +11,7 @@ function AStar(s, e, row, col, inputGrid) {
11
const end = e;
12
const path = [];
13
14
- if (end.i > inputGrid.length || end.j > inputGrid[0].length) {
+ if (end.i >= inputGrid.length || end.j >= inputGrid[0].length) {
15
throw new Error('Error: Endpoint outside grid bounds');
16
}
17
0 commit comments