Q7: N-Queens problem: There is an n x n grid where the value of n is 4≤n≤8 (user shall be asked at run time for the value of n he wants to keep). Your task is to place n queens on this board. As per the rules of chess, a queen should have no other queen in its respective column, neither should it have any other queen in its row nor should it have any within its diagonal cells. You can consider this case as placing each queen individually per column such that it does not violate any of the constraints mentioned. It’s quite easy to find solution manually but your task is now to code it and find the correct positions for the queens. This problem has to be solved through the concept of backtracking. So initially you will place the first queen randomly at any location within column 1. With respect to its location, now next n-1 queens’ domain i.e. the places where they can be placed might shrink up. E.g. in this case 4 queens have to placed and Q1 is placed on (0,0) so x positions represent the illegal places now where other queens cannot be placed due to Q1 placement. This means for rest of the queens some positions have been considered as illegal. Further up, when we will move forward, there might be a point where domain gets empty for any particular queen, at that instance apply backtrack concept, which means that location of previous queen will have to get changed. Advise: Start building up your logic first on 4 queen problem so that you may exactly understand the flow then go for making a generalized code version of n queens’ placement. Comments your code where necessary to make it clean and clear.