Question d’entretien chez Acorns

Find if this array has x. We talked about optimization in this question.