Google interview question

Algorithms