Pergunta de entrevista da empresa Devron

They asked me a typical DSA question with 2D array manipulation