• + 0 comments

    print(re.sub("(?<=\w)(\W+)(?=\w)"," ","".join([matrix[j][i] for i in range(m) for j in range(n)])))