Pergunta de entrevista da empresa Google

Sum of all elements in an array with insertions and deletions.