Back to problems

Cheapest Round-Trip Flight

Algorithm · Uber · Medium

Minimum Round-Trip Cost Medium · Topics · Company Tags · Hints You are planning a trip that requires booking a departure flight and a return flight. You have two integer arrays, departureCosts and returnCosts, both of length n. Index i represents a possible departure day, and departureCosts[i] is the price of the outbound flight on that day. Similarly, returnCosts[j] is the price of the inbound flight when returning on day j. To book a valid round trip, you must choose a…

Checking your access…