Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Cipher Map by vvm70
from typing import List
def recall_password(grille: List[str], password: List[str]) -> str:
s = ''
for _ in range(4):
s += ''.join(p for g, p in zip(''.join(grille), ''.join(password)) if g == 'X')
grille = [''.join(a[::-1]) for a in zip(*grille)]
return s
if __name__ == '__main__':
print("Example:")
print(recall_password(['X...', '..X.', 'X..X', '....'],
['itdf', 'gdce', 'aton', 'qrdi']))
# These "asserts" are used for self-checking and not for an auto-testing
assert recall_password(['X...', '..X.', 'X..X', '....'],
['itdf', 'gdce', 'aton', 'qrdi']) == 'icantforgetiddqd'
assert recall_password(['....', 'X..X', '.X..', '...X'],
['xhwc', 'rsqx', 'xqzz', 'fyzr']) == 'rxqrwsfzxqxzhczy'
print("Coding complete? Click 'Check' to earn cool rewards!")
Aug. 25, 2020
Comments: