Pregunta de entrevista de Rippling

Leetcode hard question about google sheet implementation