
# ++++++ to be replaced by tester ++++++
mylog = print
myexactlog = print
"+++++++++++++++++"

def test():
  "--- test function ---"
  param = [
    # example 1
    [[[3, 3, 1, 1], [2, 2, 1, 2], [1, 1, 1, 2]]]
    # output: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]
    ,
    # example 2
    [[[11, 25, 66, 1, 69, 7], [23, 55, 17, 45, 15, 52], [75, 31, 36, 44, 58, 8], [22, 27, 33, 25, 68, 4], [84, 28, 14, 11, 5, 50]]]
    # output: [[5,17,4,1,52,7],[11,11,25,45,8,69],[14,23,25,44,58,15],[22,27,31,36,50,66],[84,28,75,33,55,68]]
    ,
  ]
  for i, parameters_set in enumerate(param):
    idx = i
    mylog(0, idx)
    result = f_gold(* parameters_set)
    myexactlog(1, result)


"-----------------"
### diagonalSort 
from typing import *
def f_gold(mat: List[List[int]]) -> List[List[int]]:
    m, n = len(mat), len(mat[0])
    for k in range(min(m, n) - 1):
        for i in range(m - 1):
            for j in range(n - 1):
                if mat[i][j] > mat[i + 1][j + 1]:
                    mat[i][j], mat[i + 1][j + 1] = mat[i + 1][j + 1], mat[i][j]
    return mat
"-----------------"
test()

