You are viewing a single comment's thread. Return to all comments →
import re n, m = list(map(int, input().split())) pattern = r'(?<=\w)\W+(?=\w)' matrix = [input() for _ in range(n)] print(re.sub(pattern, ' ', ''.join([x[i] for i in range(m) for x in matrix])))
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 →