Algorithm · Uber · Hard
You are given a list of directed currency conversion edges. Each entry has the form [from, to, rate], meaning that one unit of from converts into rate units of to. A conversion path applies every edge along the path by multiplication, so a path $$c_0 \to c_1 \to \cdots \to c_k$$ with edge rates $$r_1, r_2, \ldots, r_k$$ has overall factor $$r_1 \times r_2 \times \cdots \times r_k$$. Implement bestConversionRate(conversions, source, target) and return the maximum achievable…
Checking your access…