Compute Infection Time in a Grid | OpenAI Interview Question