Pregunta de entrevista de Google

DSA question, almost certainly on Leetcode