Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 1.59 KB

README.md

File metadata and controls

21 lines (13 loc) · 1.59 KB

cookiedelivery

You are but a humble pastry chef who moved to a new town at the beginning of the year to start your own boulangerie/patisserie, the culmination of your childhood dreams. Thanks to your hard work, a little luck, and a rave review in the local alt weekly, your little French bakery has become a celebrated part of both the daily routines and special occasions of the citizens of your new town.

To thank your favorite regulars, you have decided to hand-deliver boxes of your special Christmas shortbread to their homes. But you cannot be out on delivery, away from your lovingly floured counters for too long, as you received more orders of Bûche de Noël than you were expecting. And oh dear, what's this? It's the mayor calling on the telephone. He has ordered a gingerbread house at the last possible minute to be ready on Christmas Eve! Time is of the essence. All that fondant won't sculpt itself.

You will need to take the shortest possible routes between each house on your shortbread delivery list. But how?

Your solution should, using Go, produce the shortest path between any two houses in the neighborhood, given a starting location and a target location.

Include a set of executable tests for your solution. The following is a set of inputs for which the correct result is known:

[See neighborhood.txt for list of nodes and edge values. Visual representation of neighborhood graph TBA]

Given: startLocation: Natalie's House targetLocation: Jake's Haunt

Expected result: distance: 31 path: ["Natalie's House", "Sophia's Apartment", "Jordan's Condo", "Danielle's Den", "Jake's Haunt"]