Company: LinkedIn_9Aug
Difficulty: medium
Hackerland Travel Cost Problem Description The country of Hackerland is depicted as a graph with g_nodes cities, numbered from 1 to g_nodes . These cities are interconnected by g_edges bidirectional roads, where the i th road connects city g_from[i] to city g_to[i] , and the fuel required to travel this road is g_weight[i] . Vehicles in Hackerland have unlimited fuel capacity, and the cost of one unit of fuel in the i th city is given by arr[i] . Any amount of fuel can be purchased in any city. Given two cities A and B (1 ≤ A, B ≤ g_nodes ), determine the minimum cost to travel from city A to city B. If travel between these cities is impossible, return -1. Function Description Complete the function getMinCost in the editor with the following parameters: int g_nodes : the number of cities int g_from_g_edges : one endpoint of each road int g_to_g_edges : the other endpoint of each road int g_weight_g_edges : the weight of each road int arr_g_nodes : the cost of unit fuel in each ci