Google Onsite | Currency Arbitrage | 2022
Anonymous User
2068

This is a similar question to https://leetcode.com/discuss/interview-question/483660/google-phone-currency-conversion but with a twist.

Input:

  • conversionRates - 2d float array of currency exchange rates.
    • [i][j] = conversion from 1 unit of i currency to j currency
      • [i][j] may be DIFFERENT than [j][i]
  • startCurrency - integer
  • endCurrency - integer

Output:

  • Maximum endCurrency possible from startCurrency to endCurrency

Notes:

  • Currency A -> B may be DIFFERENT than B->A conversion
  • You cannot convert to the same currency more than once
  • Up to 18 currencies
Comments (7)