You are viewing a single comment's thread. Return to all comments →
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) s = ''.join(matrix[y][x] for x in range(m) for y in range(n)) p = r'(?<=[a-zA-Z0-9])[!@#$%&\s]+(?=[a-zA-Z0-9])' print(re.sub(p, ' ', 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 →