35 lines
723 B
Python
35 lines
723 B
Python
# See the overview from 2026.07.31.
|
|
# Note: I added Anaheim to the sample graph here. The solution should work
|
|
# appropriately with either graph.
|
|
|
|
sample_graph = {
|
|
'Santa Ana': {
|
|
'Los Angeles': 5,
|
|
'Anaheim': 3,
|
|
'Palm Springs': 50
|
|
},
|
|
'Anaheim': {
|
|
'Los Angeles': 2,
|
|
'Santa Ana': 3
|
|
},
|
|
'Los Angeles': {
|
|
'Anaheim': 2,
|
|
'San Francisco': 25,
|
|
'Santa Ana': 5
|
|
},
|
|
'Palm Springs': {
|
|
'San Francisco': 30,
|
|
'Santa Ana': 50
|
|
},
|
|
'San Francisco': {
|
|
'Los Angeles': 25,
|
|
'Palm Springs': 30
|
|
}
|
|
}
|
|
|
|
def possible_paths(start: str, end: str):
|
|
# TODO
|
|
pass
|
|
|
|
print(possible_paths('Santa Ana', 'San Francisco'))
|