← 返回 uber 的题目列表Currency Exchange Algorithm
类型:online_judge
Implement a currency exchange algorithm that reads exchange rates between currencies and calculates the optimal conversion path from one currency to another. The input is a series of currency pairs with their exchange rates, in the format [from, to, rate]. Output the maximum convertible amount from the start currency to the target currency. Provide a complete code solution.
Example
Input
[[['USD', 'EUR', 0.9], ['EUR', 'JPY', 120.0], ['USD', 'GBP', 0.75]], 'USD', 'JPY']