Pregunta de entrevista de Google

They asked to solve a coding problem required knowledge of implementing maths in code