Google interview question

Coding problem related to lists manipulation