10269

This can be done two ways using floyed-warshall algorithm and also using bfs;

Floyed warshall:

BFS:

 

Leave a Reply

Your email address will not be published. Required fields are marked *