Multi-source BFS. Start with all rotten oranges in the queue simultaneously.
BFS explores level by level. Each level represents one minute passing. All oranges that rot at the same time are processed together.
Count fresh oranges initially. Each time a fresh orange rots, decrement the count. When the queue is empty, if fresh count is 0, return the minutes elapsed. Otherwise return -1.