Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Cipher Map 2 (with zip) solution in Clear category for Cipher Map by tssrkt777
from typing import List
def recall_password(gri: List[str], pas: List[str]) -> str:
res = ''
for _ in range(4):
res += ''.join(x for p, g in zip(pas, gri) for x, y in zip(p, g) if y == 'X')
gri = list(zip(*gri[::-1]))
return res
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!")
Oct. 20, 2021
Comments: