Pergunta de entrevista da empresa eBay

Coding question: search for an element in a sorted matrix