Continental Interview Question

easy array question on leet code