• + 0 comments

    I think the designer of the problem, should answer this observation. Please do not say to solve it with below solution, since we all know this solution works. However, this solution, was not described the way the original question is described.

    Thanks

    sum_arr = []

    for row in range(n):
        for col in range(n):
            max_of = max([matrix[row][col],matrix[row][2*n-1-col],matrix[2*n-1-row][col],matrix[2*n-1-row][2*n-1-col]])
            print("Comparing max among these elements:")
            print([matrix[row][col],matrix[row][2*n-1-col],matrix[2*n-1-row][col],matrix[2*n-1-row][2*n-1-col]])
            sum_arr.append(max_of)
            print(row, col, max_of, sum_arr)
    return sum(sum_arr)