You are viewing a single comment's thread. Return to all comments →
import re n, m = map(int, input().split()) matrix = [list(input()) for _ in range(n)] s = "".join(["".join(col) for col in zip(*matrix)]) print(re.sub(r"(?<=[a-zA-Z0-9])[^a-zA-Z0-9]+(?=[a-zA-Z0-9])", " ", s))
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 →