Minimum Cost to Send People to Two Cities (Generalized to K)

Problem: Minimum Cost to Send People to SF and NY (Generalized to K)

You are given n people (for Part 1, n is even). Each person can travel either to San Francisco (SF) or **New York (NY)*...

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: