P3: N-Queens A &BInstructions
NQueensA: Write a brief Python program torandomly generate a solution to the N-Queens problem (described onpages 71-72). Your program should:
Prompt theuser for a value for N (for an NxN board)
Generate arandomized candidate NQ solution
Count thenumber of conflicting pairs of queens
Repeat theprevious two steps until you get a solution
Print thesolution and the number of iterations the solution took
Submit your file as NQueensA_yourInitials.py(e.g. NQueensA_BRP.py), and note in the Submission Comments in D2Lthe largest n-queens solution itwas able to generate in reasonable time (start atn=4 and work up) and how manyiterations it took.
Pseudocode:
# NQueensA_yourInitials.pyimport random# ask the user for an
PayPal Gateway not configured
PayPal Gateway not configured