Created
October 26, 2019 00:51
-
-
Save mrvnmchm/669a5393dc01688d64c2255ca66c26d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Import original script | |
matrix = list() | |
for _ in range(int(input().split()[0])): | |
matrix.append(list(input())) | |
# Rotate the matrix | |
matrix = list(zip(*matrix)) | |
# Prep regex sample | |
sample = str() | |
for subset in matrix: | |
for letter in subset: | |
sample += letter | |
# Substitute invalid characters with a space | |
print(re.sub(r'(?<=\w)([^\w\d]+)(?=\w)', ' ', sample)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why was this so confusing, smh