Pergunta de entrevista da empresa Morgan Stanley

To solve a matrix searching problem and how to optimize it