Mastercard interview question

Sort a 2D matrix (DSA problem)