Directi | SDE | 28 November

Directi · Question · Posted Apr 2020

Given map of N museums with given entry fees and M weighted bidirectional roads connecting them. Starting from each museum, we need to find minimum cost to visit at least one museum. The cost will be an addition of sum of weights of roads travelled and visited museum entry fee. Input Number of museums N and number of roads M Entry fees of each museum Next M lines will have x, y, z where museum x and museum y are ...

The full answer & interview discussion are available to premium members.

Log in Create a free account