Amazon Interview Question

DSA Question related to Graphs