Hi, I have a python coding questions and would need help:
Count the neighbors of each node in a graph. input graph is a multi-dimensional list
Let's say I want to have each person's friends count:
input (list of list): [[A, B], [B, C], [B, D], [E]],
output (dict): {A:1, B: 3, C:1, D:1, E:0}
assume you won't get a repeat pair like [A,B] and [B,A], and neither will there be more than 2 people in a relationship.
I want to write a function that creates a dictionary of how many friends each person has. People can have 0 to many friends.