Pergunta de entrevista da empresa Google

I was asked to solve a data-structure problem in Python involving manipulating arrays and using an efficient algorithm.