Pregunta de entrevista de Google

Prefix sum question which worked on ranges