Algorithm · Rippling · Hard
Given a list of currency quotes and a batch of conversion requests, report each converted amount. A quote is a triple [from, to, rate] meaning that one unit of from is worth rate units of to; the same quote also permits travel in the opposite direction, turning one unit of to into 1 / rate units of from. The same pair of currencies may be quoted several times, and every quote stands as its own usable edge. For every request [source, target, amount], return the money…
Checking your access…