For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
We are a currency exchange that maintains the current exchange rates between currencies. A user can come to us with some amount in one currency and request the equivalent amount in a different currency. Given a list of exchange rates between currencies, write a function that calculates currency rate between any 2 currencies.
Example:
(GBP, EUR, 10) - read as "1 GBP equals 10 EUR"
(EUR, USD, 1.1) - "1 EUR equals 1.1 USD"
(10, GBP, USD) => ? - "10 GBP equals how many USD?"
Answer: 110
Explanation: 10 GBP = 10 x (10 EUR) = 10 x (10 x (1.1 USD)) = 110 USD
We are a currency exchange that maintains the current exchange rates between currencies. A user can come to us with some amount in one currency and request the equivalent amount in a different currency. Given a list of exchange rates between currencies, write a function that calculates currency rate between any 2 currencies.
Example:
(GBP, EUR, 10) - read as "1 GBP equals 10 EUR"
(EUR, USD, 1.1) - "1 EUR equals 1.1 USD"
(10, GBP, USD) => ? - "10 GBP equals how many USD?"
Answer: 110
Explanation: 10 GBP = 10 x (10 EUR) = 10 x (10 x (1.1 USD)) = 110 USD
Output