Google interview question

Basic Algorithm coding test