ServiceNow interview question

Asked me to solve an array problem.