Google | Phone screen | Delete nodes & Currency rate
Anonymous User
1476

Question 1:

Question 2:

  • Variation of https://leetcode.com/problems/evaluate-division
    euro -> dollar = 0.42
    yard -> meter = 0.898
    You are given an input file of currency relations as it was shown above. You have Q number of queries, where each query has two inputs: from and to ("euro", "pound"). As a result for that query, you need to return its relation (coefficient) between those two nodes, if there is no such relation return -1.

    NOTE:

    1. It's guaranteed that the coefficient between nodes "A" and "B" will be the same, no matter which road it takes.
    2. You can assume a graph as undirected.
Comments (1)