Point72 Interview Question

Graph problem using breadth first search