Skip to content

Instantly share code, notes, and snippets.

@meet100ni
Created May 13, 2020 13:29
Show Gist options
  • Save meet100ni/cee68d697021c6b01f511505dc86e5eb to your computer and use it in GitHub Desktop.
Save meet100ni/cee68d697021c6b01f511505dc86e5eb to your computer and use it in GitHub Desktop.
Matrix Script HackerRank Solution
# Remove the given code and pest this code
#!/bin/python3
import re
n, m = map(int, input().split())
a, b = [], ""
for _ in range(n):
a.append(input())
for z in zip(*a):
b += "".join(z)
print(re.sub(r"(?<=\w)([^\w]+)(?=\w)", " ", b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment