```
int rows[9] = {0}, cols[9] = {0}, squares[9] = {0};
int i, j;
int tmp, b, sq;
for (i = 0; i < 9; i++) {
for (j = 0; j < 9; j++) {
if (board[i][j] == '.') {
continue;
}
b = board[i][j] - '1';
if (b > 8 || b < 0) {
return false;
}
tmp = 1 << b;
if (rows[i] & tmp) {
return false;
}
rows[i] |= tmp;
if (cols[j] & tmp) {
return false;
}
cols[j] |= tmp;
sq = (i / 3) * 3 + (j / 3);
if (squares[sq] & tmp) {
return false;
}
squares[sq] |= tmp;
}
}
return true;
```

343 / 501 test cases passed.

This wrong case is :

Input: [".87654321","2........","3........","4........","5........","6........","7........","8........","9........"]

Output: false

Expected: true