Pergunta de entrevista da empresa Tata Consultancy Services

A programming question about sorting matrix?