Sunday common C++ interview problem: Shortest path to visit all nodes.
Given a connected graph as an adjacency list (std::vector<std::vector<unsigned>>), return the length of the shortest path that visits all nodes.
The path may revisit nodes and edges. You can assume a computationally feasible number of nodes.
Solve it yourself: https://compiler-explorer.com/z/qz9G3zdoh
Solution: https://compiler-explorer.com/z/bv6evYxo1