Amazon interview question

Justify the suduku

Interview Answers

Anonymous

7 Apr 2012

oh, we need to use loops? that's very helpful.

Anonymous

12 Apr 2012

the function can be like this(not tested): boolean test(byte[27][9] input) { for ( int i = 0; i < 27; i++) { short result = 0; for (int j=0; j<9; j++) { result |= 1<<(input[i][j]-1); if (result != 0x1ff) { return false; } } return true; }

Anonymous

21 Feb 2012

write loops to test it