Tell us what’s happening:
I assume that function is giving expected output with all given outside testcases. Not sure, what’s wrong in here?
Can someone help me out here, please?
Your code so far
def adjacency_list_to_matrix(graph):
matrix = []
size = len(graph)
for i in range(size):
row = [0]*size
node = graph[str(i)]
for j in node:
row[j] = 1
matrix.append(row)
print(row)
return matrix
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:146.0) Gecko/20100101 Firefox/146.0
Challenge Information:
Build an Adjacency List to Matrix Converter - Build an Adjacency List to Matrix Converter