Company: MediaNet_5sep
Difficulty: medium
Hungry Policemen Problem Description You are given a graph G of N nodes and M edges, where each edge carries a travel time. Every node except Node N has exactly one policeman stationed on it. Word reaches every policeman that a thief is holed up at Node N, so they all set out toward it. Being famished, though, each one is tempted to make a detour to a restaurant along the way before finishing the trip to Node N. K of the nodes have a restaurant, and each restaurant offers some amount of satisfaction. A policeman will only stop at a restaurant if the satisfaction it offers is strictly greater than the total time spent getting there and then continuing on to Node N. Find and return how many policemen end up eating at a restaurant. Input Format: The first argument contains an integer A, representing the number of nodes. The second argument of input contains a 2-d matrix of size M x 3, B, where Node B[i][0] and Node B[i][1] are bidirectionally connected with an edge that takes B[i][2] time