MathWorks interview question

Array question LC easy question