Walmart Global Tech interview question

Live coding question involving arrays