Pregunta de entrevista de Google

A math-based DSA problem that tested logical reasoning and implementation skills.