Skip to content

Instantly share code, notes, and snippets.

View sheldonrobinson's full-sized avatar

Sheldon Robinson sheldonrobinson

View GitHub Profile
@sheldonrobinson
sheldonrobinson / isCryptSolution.py
Created October 5, 2019 02:12
CodeSignal Solution isCryptSolution
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]
@sheldonrobinson
sheldonrobinson / sudoku2.py
Last active October 5, 2019 02:11
CodeSignal Solution for sudoku2
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
@sheldonrobinson
sheldonrobinson / rotateImage.py
Created October 3, 2019 22:20
CodeSignal Solution: rotateImage
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