Floyd-Warshall algorithm, BFS
Ad hoc on string
Time waster ad hoc
Time waster ad hoc (make code clean for easy debugging)
Simulation, ad hoc
Input string trim, parse, ad hoc