New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
OpenAI
Coding Question
AI Insights
Quick Summary
Simulate disease spread across an MxN grid where healthy cells become infected if they meet a neighbor threshold.
Apply updates simultaneously day-by-day to accurately measure the time until the epidemic stabilizes.
Return 0 immediately if no healthy cell can satisfy the threshold on the first evaluation.
What This Tests
Multi-source Breadth-First Search simulation
Grid traversal and 8-directional neighbor analysis
Batch state updates to enforce synchronous time steps
Boundary handling and early termination logic
Common Patterns
Breadth-First Search
Simulation
Grid Traversal
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected