MathWorks Interview Question

LeetCode type question for Algorithm and data structure