In single-source BFS, you push one cell to the queue and explore outward. In multi-source BFS, you push all starting cells to the queue before you begin.
Here, all initially rotten oranges are pushed to the queue at time . Then BFS spreads the rot in waves. After minute , all fresh oranges adjacent to any initial rotten orange become rotten. After minute , the rot spreads one more layer out.
The queue processes cells level by level. Each level corresponds to one minute. When the queue empties, you check if any fresh oranges remain. If yes, return . If no, return the elapsed minutes.