public Object key(){
  int dr=+1;
  int dc=+1;
  boolean rFirst=true;
  int d=board[0][0];
  if (board[0][2] < d) {
    dr=+1;
    dc=-1;
    d=board[0][2];
    rFirst=false;
  }
  if (board[2][2] < d) {
    dr=-1;
    dc=-1;
    d=board[2][2];
    rFirst=true;
  }
  if (board[2][0] < d) {
    dr=-1;
    dc=+1;
    d=board[2][0];
    rFirst=false;
  }
  StringBuilder sb=new StringBuilder(10);
  if (rFirst) {
    for (int r=-dr + 1; dr * r <= dr + 1; r+=dr) {
      for (int c=-dc + 1; dc * c <= dc + 1; c+=dc) {
        sb.append(board[r][c]);
      }
    }
  }
 else {
    for (int c=-dc + 1; dc * c <= dc + 1; c+=dc) {
      for (int r=-dr + 1; dr * r <= dr + 1; r+=dr) {
        sb.append(board[r][c]);
      }
    }
  }
  return sb.toString();
}

public Object key ( ) { int dr = + 1 ; int dc = + 1 ; boolean rFirst = true ; int d = board [ 0 ] [ 0 ] ; if ( board [ 0 ] [ 2 ] < d ) { dr = + 1 ; dc = - 1 ; d = board [ 0 ] [ 2 ] ; rFirst = false ; } if ( board [ 2 ] [ 2 ] < d ) { dr = - 1 ; dc = - 1 ; d = board [ 2 ] [ 2 ] ; rFirst = true ; } if ( board [ 2 ] [ 0 ] < d ) { dr = - 1 ; dc = + 1 ; d = board [ 2 ] [ 0 ] ; rFirst = false ; } StringBuilder sb = new StringBuilder ( 10 ) ; if ( rFirst ) { for ( int r = - dr + 1 ; dr * r <= dr + 1 ; r += dr ) { for ( int c = - dc + 1 ; dc * c <= dc + 1 ; c += dc ) { sb . append ( board [ r ] [ c ] ) ; } } } else { for ( int c = - dc + 1 ; dc * c <= dc + 1 ; c += dc ) { for ( int r = - dr + 1 ; dr * r <= dr + 1 ; r += dr ) { sb . append ( board [ r ] [ c ] ) ; } } } return sb . toString ( ) ; }
return key that satisfies rotational symmetry . < p > considering the four corners of the board , select the lowest digit and then read off the remaining eight positions in a fixed order as an integer . return that value .
