Cheapest Round-Trip Flight

Given two integer arrays of length n:

  • A[i]: outbound flight price when departing on day i;
  • B[i]: return flight price when returning on day i.

Choose a departure day i and a return da...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: