Pergunta de entrevista da empresa Level AI

Basic binary search question (not on leetcode).