Exercise

Shortest Path III

This is the final exercise of this trio! You're now going to complete the problem by writing the code that returns False if there's no path between two nodes.

Instructions

100 XP
  • Check to see if the queue has been emptied. You can do this by inspecting the last element of queue with [-1].
  • Place the appropriate return statement for indicating whether there's a path between these two nodes.