package com.fishercoder.solutions;

/**
 * 847. Shortest Path Visiting All Nodes
 *
 * An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1) is given as graph.
 * graph.length = N, and j != i is in the list graph[i] exactly once, if and only if nodes i and j are connected.
 * Return the length of the shortest path that visits every node.
 * You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.
 *
 * Example 1:
 * Input: [[1,2,3],[0],[0],[0]]
 * Output: 4
 * Explanation: One possible path is [1,0,2,0,3]
 *
 * Example 2:
 * Input: [[1],[0,2,4],[1,3,4],[2],[1,2]]
 * Output: 4
 * Explanation: One possible path is [0,1,4,2,3]
 *
 * Note:
 * 1 <= graph.length <= 12
 * 0 <= graph[i].length < graph.length
 * */
public class _847 {
    public static class Solution1 {
        public int shortestPathLength(int[][] graph) {
            //TODO: implement this
            return -1;
        }
    }
}

@@ -33,746 +33,8 @@
 s;%0A%0A
-/**%0A * 847. Shortest Path Visiting All Nodes%0A *%0A * An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1) is given as graph.%0A * graph.length = N, and j != i is in the list graph%5Bi%5D exactly once, if and only if nodes i and j are connected.%0A * Return the length of the shortest path that visits every node.%0A * You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.%0A *%0A * Example 1:%0A * Input: %5B%5B1,2,3%5D,%5B0%5D,%5B0%5D,%5B0%5D%5D%0A * Output: 4%0A * Explanation: One possible path is %5B1,0,2,0,3%5D%0A *%0A * Example 2:%0A * Input: %5B%5B1%5D,%5B0,2,4%5D,%5B1,3,4%5D,%5B2%5D,%5B1,2%5D%5D%0A * Output: 4%0A * Explanation: One possible path is %5B0,1,4,2,3%5D%0A *%0A * Note:%0A * 1 %3C= graph.length %3C= 12%0A * 0 %3C= graph%5Bi%5D.length %3C graph.length%0A * */%0A
 publ

refactor 847