Add one last node, D
, which is connected with A
and C
. Modify your dictionary to represent this structure. Again, use a list to represent multiple connections. Guess what, I did, and the code isn’t working!
Here is my code:
# User Editable Region
my_graph = {
'A': 'B',
'B': ['A', 'C'],
'C': 'B',
'D': ['A', 'C']
}
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Challenge Information:
Learn Algorithm Design by Building a Shortest Path Algorithm - Step 14