You are viewing a single comment's thread. Return to all comments →
this below is completely waste of time but it works for all test cases:
import math import os import random import re import sys 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) f=[] for j in range(len(matrix[0])): for i in range(len(matrix)): word=matrix[i] f.append(word[j]) symb=['!','@','#','$','%','&'] for i in range((len(f))): if(f[i] in symb): try: if(f[i+2].isalpha() or f[i+3].isalpha()): f[i]=' ' except: e='' try: if(f[i-2].isalpha() and f[i+2].isalpha()): f[i]=' ' except: e='' for i in range((len(f))-6): if((f[i]==' ') and (f[i+1]==' ')): f[i]='' final=''.join(f) print(final)
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 →
this below is completely waste of time but it works for all test cases: