Amazon Question Please Help
Anonymous User
2155

Please give a suggestion to a similar problem or help me solve this one, Thank you!
This is SDE2 amazon onsite question
Coding (Data Structures + Algorithms) question
Amazon can deliver to over 70% of the US population within a day – but it doesn’t have a dedicated fulfillment center for every city. Instead, Amazon strategically locates a minimum number of fulfillment centers that together can form such an efficient supply chain.

Given a set of major cities that need to be covered, and knowledge of which cities are within a day delivery of each other, provide the minimum number of fulfillment centers required to cover all locations.

Input:
Seattle
Portland
Boston
San Francisco
Los Angeles
Chicago
Philadelphia
New York
Denver

(Seattle, Portland)
(Los Angeles, San Francisco)
(San Francisco, Portland)
(San Francisco, Seattle)
(New York, Philadelphia)
(New York, Boston)
(Boston, Philadelphia)
(Chicago, Philadelphia)
(Los Angeles, Denver)
(Denver, Chicago)

Output:
(one solution)
3 – San Francisco, Chicago, Boston

Comments (4)