Google interview question

Array problem, addition and removal.