MathWorks interview question

Binary search based leetcode question