Walmart Global Tech interview question

Medium LC binary search problem and matrix