Pramp interview question

Given a sorted array, return the first element that matches the index