This is the canonical multi-source BFS problem. It tests your ability to recognize that BFS naturally models "spreading" phenomena with level-by-level processing.
Enable JavaScript for the full StreamPrep guide.