```
public boolean isValidSudoku(char[][] board) {
boolean[][] row=new boolean[9][9];
boolean[][] column=new boolean[9][9];
boolean[][] cube=new boolean[9][9];
for(int i=0;i<9;i++){
for(int j=0;j<9;j++){
if(board[i][j]=='.')continue;
int loc=board[i][j]-'1';
if(row[i][loc]||column[j][loc]||cube[(i/3)*3+j/3][loc])return false;
row[i][loc]=true;
column[j][loc]=true;
cube[(i/3)*3+j/3][loc]=true;
}
}
return true;
}
```

just a label transfer for cube ; number=(i/3)*3+(j/3);then go on very easy to think