Plan Round Trip With Minimum Flight Cost
Asked at Meta · Coding Questions · Difficulty: Medium
You are given equal-length integer arrays `D` and `R`, where `D[i]` is the departure cost on day `i` and `R[i]` is the return cost on day `i`. Choose a departure day `i` and a return day `j` with `i < j` minimizing `D[i] + R[j]`. Return `(depart_index, return_index, min_cost)`. Break ties by the earliest departure day, then (if departure ties) the latest return day.
Loading the problem…