This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def decrypt(word, dictionary): | |
| lst =[] | |
| for c in word: | |
| lst.append(dictionary[c]) | |
| return ''.join(lst) | |
| def isCryptSolution(crypt, solution): | |
| dict = {} | |
| for r in solution: | |
| dict[r[0]] = r[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sudoku2(grid): | |
| # test row | |
| tab = [[False for col in range(9)] for row in range(9)] | |
| cols = [[False for col in range(9)] for row in range(9)] | |
| rows = [[False for col in range(9)] for row in range(9)] | |
| for r in range(9): | |
| for c in range(9): | |
| if grid[r][c] == ".": | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def rotateImage(a): | |
| w = len(a) | |
| h = w | |
| img =[0]*h | |
| for col in range(h): | |
| img_row = [0]*w | |
| for row in range(w): | |
| img_row[h-row-1] = a[row][col] | |
| img[col] = img_row |
NewerOlder