Python checkio Cipher map解决方案
来源:互联网 发布:izeeyu是什么软件 编辑:程序博客网 时间:2024/06/01 09:43
我的解决方案:def recall_password(cipher_grille, ciphered_password): result ='' rangenumber = len(cipher_grille) positionlist = [] [positionlist.append((i,j)) if cipher_grille[i][j] == 'X' else '' for i in range(rangenumber) for j in range(rangenumber)] for j in range(rangenumber): c = ([ciphered_password[positionlist[i][0]][positionlist[i][1]] for i in range(rangenumber)]) result += ''.join(c) for k in range(0,rangenumber): positionlist[k]=(positionlist[k][1], rangenumber - 1 -positionlist[k][0]) positionlist.sort() return result其他解决方案:def recall_password(cipher_grille, ciphered_password): answ = ["","","",""] for x in range(4): for y in range(4): if cipher_grille[x][y] == 'X': answ[0]+= ciphered_password[x][y] if cipher_grille[3-y][x] == 'X': answ[1]+= ciphered_password[x][y] if cipher_grille[3-x][3-y] == 'X': answ[2]+= ciphered_password[x][y] if cipher_grille[y][3-x] == 'X': answ[3]+= ciphered_password[x][y] return answ[0] + answ[1] + answ[2] + answ[3]def recall_password(cipher_grille, ciphered_password):
x=cipher_grille
y=ciphered_password
answer=[]
for u in range(4):
c=0
for i in x:
for t in range(4):
if i[t]=="X":
answer.append(y[c][t])
c+=1
x = list(zip(*x[::-1]))
return "".join(answer)
阅读全文
0 0
- Python checkio Cipher map解决方案
- Python checkio median解决方案
- Python checkio "Friends"解决方案
- Python checkio Monkey Typing解决方案
- Python checkio Pawn Brotherhood解决方案
- Python checkio Long Repeat解决方案
- Python checkio First Word解决方案
- Python checkio Secret Message解决方案
- Python checkio Index Power解决方案
- Python checkio Digits Multiplication解决方案
- Python checkio Days Between解决方案
- Python checkio Boolean Algebra解决方案
- Python checkio "Ghosts age"解决方案
- Python checkio "Striped Words"解决方案
- Python checkio "Speech Module"解决方案
- Python checkio "Making Change"解决方案
- Python checkio "Building Base"解决方案
- Python checkio Min and Max解决方案
- MySQL 主从复制详解(详细)
- maven入门
- mysql中事件失效如何解决
- VOT2015 Benchmark简易教程
- PAT乙级1020. 月饼 (25) 背包问题
- Python checkio Cipher map解决方案
- 900B
- STM32 Error:Flash download failed
- How to fix the python problem 'xxx() takes exactly one argument'
- React Native 截屏组件
- js+css3动画实现手风琴
- JDK中rt.jar、tools.jar和dt.jar作用
- iOS_43_Reactivecocoa
- 使用jqueryForm ajax提交表单