Google interview question

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