MathWorks interview question

Not able to clear previous round