Continental interview question

easy array question on leet code