Two Sigma Interview Question

Simple BFS problem, data