Skip to content

Commit d855dcf

Browse files
Updated solution of Among Us
1 parent e2ffc66 commit d855dcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Among Us/solution.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ int main() {
2626
grid[i][j]--;
2727
}
2828
}
29-
// If starting cell is blocked, the answer will be 0
30-
if (grid[0][0] == -1) {
29+
// If starting cell or ending cell is blocked, the answer will be 0
30+
if (grid[0][0] == -1 || grid[r - 1][c - 1] == -1) {
3131
cout << "0\n";
3232
return 0;
3333
}

0 commit comments

Comments
 (0)