has_arbitrage(rates: list[list[float]]) -> bool.rates[i][j] gives the number of units of currency j obtained by converting 1 unit of currency i. Every diagonal value is 1.True when such an opportunity is present; otherwise return False.n = 2, rates [[1, 0.25], [4.0, 1]] → False.
The two conversions multiply the starting amount by , and applying the 0.01% fee makes the final amount smaller than what you began with.