• + 3 comments

    I guess it can be solved using A* search algorithm, Dijkstra

    Find Office to all nodes shortest distance and store it in a dictionary.

    Find shortest path from home to office and store all edges in a set.

    If deleted edge is not in shortest path, return stored shortest path length O(1)

    if it is in shortest paththen use A* algorithm using Office to Node shortest path as Heurestic for A* Worst case complexity of dijkstra but several times better than dijkstra...