Function to check queens placement
for i in range ( 1 , n + 1 ) : NEW_LINE INDENT if self . canPlace ( k , i ) : NEW_LINE INDENT self . arr [ k ] = i NEW_LINE if k == n : NEW_LINE INDENT self . display ( n ) NEW_LINE DEDENT else : NEW_LINE INDENT self . nQueens ( k + 1 , n ) NEW_LINE DEDENT DEDENT DEDENT