Search⌘ K
AI Features

Two City Scheduling

Understand how to solve the Two City Scheduling problem by applying greedy techniques to minimize interview costs while assigning exactly half of the candidates to each city. This lesson guides you through the problem constraints and offers a structured approach to implementing the solution.

Statement

A recruiter plans to hire n\textbf{\textit{n}} people and conducts their interviews at two different locations of the company. He evaluates the cost of inviting candidates to both these locations. The plan is to invite 50% at one location, and the rest at the other location, keeping costs to a minimum.

We are given an array, costs, where  ...