Question: slove using python 3 write a function called getCommonFriends(user1, user2, network) that will return the common numbers in any list. for example: network=[(0, [1, 2,
slove using python 3
write a function called getCommonFriends(user1, user2, network) that will return the common numbers in any list. for example:
network=[(0, [1, 2, 3]), (1, [0, 4, 6, 7, 9]), (2, [0, 3, 6, 8, 9]), (3, [0, 2, 8, 9]), (4, [1, 6, 7, 8]), (5, [9]), (6, [1, 2, 4, 8]), (7, [1, 4, 8]), (8, [2, 3, 4, 6, 7]), (9, [1, 2, 3, 5])]
user1=3
user2=1
getCommonFriends returns: [0,9]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
