This file contains 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 same_row(x, y, grid): | |
for j in xrange(9): | |
if j != y and grid[x][j] != '0': | |
yield grid[x][j] | |
def same_column(x, y, grid): | |
for i in xrange(9): | |
if i != x and grid[i][y] != '0': | |
yield grid[i][y] |