Algorithm · Coinbase · Hard
You are given a set of currency exchange pairs along with their conversion rates. For example, a rate like GBP → USD: 109.0 means 1 unit of GBP can be exchanged for 109.0 units of USD. Implement a class CurrencyConverter that supports the following operations: CurrencyConverter(String[] fromArr, String[] toArr, double[] rateArr) Initializes the converter. The arrays fromArr, toArr, and rateArr are parallel, where fromArr[i] can be exchanged for toArr[i] at the given…
Checking your access…