Slug: graph-rotten-01 · Paired reading: Chapter 21
Prompt
Grid of 0 empty, 1 fresh, 2 rotten. fn oranges_rotting(grid: &mut [Vec<i32>]) -> i32
— minutes until all fresh are rotten (multi-source BFS), or -1 if impossible.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
intermediate · order 136
Slug: graph-rotten-01 · Paired reading: Chapter 21
Grid of 0 empty, 1 fresh, 2 rotten. fn oranges_rotting(grid: &mut [Vec<i32>]) -> i32
— minutes until all fresh are rotten (multi-source BFS), or -1 if impossible.