Skip to content

Commit ee52d5d

Browse files
refactor 847
1 parent 1d86a0d commit ee52d5d

File tree

1 file changed

+0
-22
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-22
lines changed

src/main/java/com/fishercoder/solutions/_847.java

-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 847. Shortest Path Visiting All Nodes
5-
*
6-
* An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1) is given as graph.
7-
* graph.length = N, and j != i is in the list graph[i] exactly once, if and only if nodes i and j are connected.
8-
* Return the length of the shortest path that visits every node.
9-
* You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.
10-
*
11-
* Example 1:
12-
* Input: [[1,2,3],[0],[0],[0]]
13-
* Output: 4
14-
* Explanation: One possible path is [1,0,2,0,3]
15-
*
16-
* Example 2:
17-
* Input: [[1],[0,2,4],[1,3,4],[2],[1,2]]
18-
* Output: 4
19-
* Explanation: One possible path is [0,1,4,2,3]
20-
*
21-
* Note:
22-
* 1 <= graph.length <= 12
23-
* 0 <= graph[i].length < graph.length
24-
* */
253
public class _847 {
264
public static class Solution1 {
275
public int shortestPathLength(int[][] graph) {

0 commit comments

Comments
 (0)