Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 509a013

Browse files
authored
Improved task 864.
1 parent 5e554ce commit 509a013

File tree

1 file changed

+1
-3
lines changed
  • src/main/java/g0801_0900/s0864_shortest_path_to_get_all_keys

1 file changed

+1
-3
lines changed

‎src/main/java/g0801_0900/s0864_shortest_path_to_get_all_keys/Solution.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ public int shortestPathAllKeys(String[] stringGrid) {
8080
&& grid[nx][ny] <= 'F'
8181
&& ((nState & (1 << (grid[nx][ny] - 'A'))) == 0)) {
8282
continue;
83-
}
84-
// not seen before
85-
if (!visited[nx][ny][nState]) {
83+
} else if (!visited[nx][ny][nState]) {
8684
q.add(new int[] {nx, ny, nState});
8785
visited[nx][ny][nState] = true;
8886
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /