C3 AI interview question

Graph question by using Adjacency List