You are viewing a single comment's thread. Return to all comments →
def encryption(s: str) -> str: temp = s.replace(" ", "") cols = ceil(sqrt(len(temp))) batch = list(batched(temp, cols)) result = [[word[c] for word in batch if len(word) > c] for c in range(cols)] return " ".join("".join(x) for x in result)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Encryption
You are viewing a single comment's thread. Return to all comments →