Skip to content

Instantly share code, notes, and snippets.

@Bruno02468
Last active June 2, 2022 02:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bruno02468/3195419e1fc00a8e26942bf929ad7952 to your computer and use it in GitHub Desktop.
Save Bruno02468/3195419e1fc00a8e26942bf929ad7952 to your computer and use it in GitHub Desktop.
EP2 da turma Python 2019 de MAC2166 -- só que em duas linhas (foi um desafio kkkkj)
z,k,m=(int(input("0 ou 1?\n")),int(input("chave?\n")),list(map(lambda c:"_ABCDEFGHIJKLMNOPQRSTUVWXYZ.".index(c),list(input("mensagem?\n").upper()))))
print("".join(map(lambda u:"_ABCDEFGHIJKLMNOPQRSTUVWXYZ."[u[1]], sorted([([i,k*i%len(m)][z]%28,[m[k*i%len(m)]-i,m[i]+i][z]%28) for i in range(len(m))], key=lambda u:u[0]))))
@Bruno02468
Copy link
Author

Bruno02468 commented Apr 27, 2019

p.s.: por 40 conto a hora ensino a fazer igual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment