ServiceNow Interview Question

Asked me to solve an array problem.