Google interview question

coding question was asked..simple one using for loop