Method to find all the queens attacking the king in the chessboard
private static List < List < Integer > > findQueens ( int [ ] [ ] queens , int [ ] king ) { List < List < Integer > > sol = new ArrayList < List < Integer > > ( ) ; int [ ] [ ] attackers = new int [ 8 ] [ 2 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { Arrays . fill ( attackers [ i ] , - 1 ) ; } for ( int i = 0 ; i < queens . length ; i ++ ) {