Pergunta de entrevista da empresa DIMOCO

I was asked to write a sorting algorithm for a 2d array.