MathWorks Interview Question

Solve the coding questions in any language