Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
::diameter solution in Clear category for Scytale Encryption by Phil15
from typing import Optional
def scytale_decipher(ciphertext: str, crib: str) -> Optional[str]:
answer = None
for diameter in range(2, len(ciphertext)):
text = ''.join([ciphertext[i::diameter] for i in range(diameter)])
if crib in text:
if answer is not None:
return None # multiple answers
answer = text
return answer
Dec. 5, 2021