PayPal interview question

Write code for shortest path algorithm