You are viewing a single comment's thread. Return to all comments →
import re import sys n,m = map(int,input().rstrip().split()) matrix = [input() for _ in range(n)] result = "".join(row[no] for no in range(m) for row in matrix) result = re.sub(r'(?<=[A-Za-z0-9])[^A-Za-z0-9]+(?=[A-Za-z0-9])',' ',result) print(result)
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 →