Samsung Electronics interview question

Graph question based on shortest path algorithm.