You are viewing a single comment's thread. Return to all comments →
Produces the same op ig, does not pass tests? #!/bin/python3 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) string = [] ans = '' last_alnum = 0 chars = "!@#$%& " for i in range(m): for j in range(n): string.append(matrix[j][i]) i = 0 while i < len( string ) : if string[i].isalnum(): ans += string[i] i += 1 else: j = i while j < len( string ) and not string[j].isalnum(): j += 1 if j == len(string): ans += ''.join(string[i:]) else: ans += ' ' i = j print (ans)
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 →