A Optimized function to check if a queen can be placed on board [ row ] [ col ]
bool isSafe ( int row , int col , int slashCode [ N ] [ N ] , int backslashCode [ N ] [ N ] , bool rowLookup [ ] , bool slashCodeLookup [ ] , bool backslashCodeLookup [ ] ) { if ( slashCodeLookup [ slashCode [ row ] [ col ] ] backslashCodeLookup [ backslashCode [ row ] [ col ] ] rowLookup [ row ] ) return false ; return true ; }