Encoded Message
This commit is contained in:
8
encodedmessage.py
Normal file
8
encodedmessage.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
def decode(s: str) -> str:
|
||||||
|
w = int(len(s) ** 0.5)
|
||||||
|
return "".join([s[v * w + h] for h in range(w) for v in range(w - 1, -1, -1)][::-1])
|
||||||
|
|
||||||
|
|
||||||
|
n = int(input())
|
||||||
|
for _ in range(n):
|
||||||
|
print(decode(input()))
|
||||||
Reference in New Issue
Block a user