```
def isValidSudoku(self, board):
dotNum = sum(row.count('.') for row in board)
# check rows
if sum(len({char for char in row if char != '.'}) for row in board) + dotNum < 81: return False
# check columns
if sum(len({board[j][i] for j in xrange(9) if board[j][i] != '.'}) for i in xrange(9)) + dotNum < 81: return False
# check 3x3 squares
if sum(len({board[i + m][j + n] for m in (0, 1, 2) for n in (0, 1, 2) if board[i + m][j + n] != '.'}) for i in (0, 3, 6) for j in (0, 3, 6)) + dotNum < 81: return False
return True
```