Google interview question

about algorithm