Newton School interview question

basically from array and strings