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 Melanie_Lilibeth_Franco_Rosado
import numpy as np
def recall_password(reglilla, contraseƱa):
contra=''
L=[]
for elemen in reglilla:
A=list(elemen)
L.append((A))
mat_reg=np.array(L)
L=[]
for elemen in contraseƱa:
A=list(elemen)
L.append((A))
mat_contra=np.array(L)
mat_reg= mat_reg=='X'
contra += ''.join(list(mat_contra[mat_reg]))
mat_reg= np.rot90(mat_reg,3)
contra += ''.join(list(mat_contra[mat_reg]))
mat_reg= np.rot90(mat_reg,3)
contra += ''.join(list(mat_contra[mat_reg]))
mat_reg= np.rot90(mat_reg,3)
contra += ''.join(list(mat_contra[mat_reg]))
return contra
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'
Feb. 2, 2017
Comments: