Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in 3rd party category for Cipher Map by Luis_Zamora_Veliz
import numpy as np
def recall_password(reglilla,contraseƱa):
retorno=''
L=[]
for elemento in reglilla:
L.append(list(elemento))
mat_rej = np.array(L)
L=[]
for elemento in contraseƱa:
L.append(list(elemento))
mat_pwd = np.array(L)
mat_rej= mat_rej=="X"
for i in range(4):
retorno = retorno + ''.join(list(mat_pwd[mat_rej]))
mat_rej = np.rot90(mat_rej,3)
return retorno
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert recall_password(
('X...',
'..X.',
'X..X',
'....'),
('itdf',
'gdce',
'aton',
'qrdi')) == 'icantforgetiddqd', 'First example'
assert recall_password(
('....',
'X..X',
'.X..',
'...X'),
('xhwc',
'rsqx',
'xqzz',
'fyzr')) == 'rxqrwsfzxqxzhczy', 'Second example'
Jan. 17, 2017
Comments: