We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I've done the same. Dijkstra's. For me, tc4 and tc5 timeout. Everything else is fine. I think it's taking too much time at finding the next vertex with smallest edge. Though I used a python dictionary, it still might take very long for all that queries.
EDIT: There are duplicate queries. Once you keep that in mind, all the tcs pass. It did for me.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Floyd : City of Blinding Lights
You are viewing a single comment's thread. Return to all comments →
I've done the same. Dijkstra's. For me, tc4 and tc5 timeout. Everything else is fine. I think it's taking too much time at finding the next vertex with smallest edge. Though I used a python dictionary, it still might take very long for all that queries.
EDIT: There are duplicate queries. Once you keep that in mind, all the tcs pass. It did for me.