data-structures-and-algorithms
401 data structures and algorithms code challenges
Project maintained by alsosteve
Hosted on GitHub Pages — Theme by mattgraham
Graph Business Trip
Feature Tasks
Challenge Type: Code Challenge / Algorithm
Method:
- business trip
- Arguments: graph, array of city names
- Return: the cost of the trip (if it’s possible) or null (if not)
Whiteboard Process

Examples
Example

Output
| Input | Output |
|—|—|
| [Metroville, Pandora, ] | $82 |
| [Arendelle, New Monstropolis, Naboo] | $115 |
| [Naboo, Pandora] | null |
| [Narnia, Arendelle, Naboo] | null |
Unit Tests
see example for testing
Stretch Goal
None
Approach & Efficiency