Choose the Cheapest Round Trip

Quick Overview

Choose departure and return days that minimize a round-trip cost while requiring departure before return. Derive a linear scan that retains the best earlier departure and implements exact ties by earliest departure index and then latest return index.

Choose the Cheapest Round Trip

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Choose departure and return days that minimize a round-trip cost while requiring departure before return. Derive a linear scan that retains the best earlier departure and implements exact ties by earliest departure index and then latest return index.

|Home/Coding & Algorithms/Meta
Meta logo
Meta
Jul 6, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
1
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...