You are viewing a single comment's thread. Return to all comments →
here is my solution icomplie in python 3
import re
first_multiple_input = input().rstrip().split()
n = int(first_multiple_input[0]) m = int(first_multiple_input[1])
matrix = []
for _ in range(n): matrix_item = input() matrix.append(matrix_item.ljust(m))
string = ''.join(matrix[row][col] for col in range(m) for row in range(n))
output = re.sub(r'(?<=\w)[!@#$&% ]+(?=\w)', ' ', string)
print(output)
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Script
You are viewing a single comment's thread. Return to all comments →
here is my solution icomplie in python 3
!/bin/python3
import re
first_multiple_input = input().rstrip().split()
n = int(first_multiple_input[0]) m = int(first_multiple_input[1])
matrix = []
for _ in range(n): matrix_item = input() matrix.append(matrix_item.ljust(m))
string = ''.join(matrix[row][col] for col in range(m) for row in range(n))
output = re.sub(r'(?<=\w)[!@#$&% ]+(?=\w)', ' ', string)
print(output)