Using the information given below, place the letters A to P inclusive in a 4x4 square grid, such that no square is vacant and each square contains a different letter.
- I is to the right of H and below B.
- C is to the left of N and above H which is to the right of P.
- P is below O and to the left of I.
- M is below A which is also to the left of I.
- K and F are to the right of L which is below G.
- J is below D which is to the left of G and M.
- E is above K and below B.
Note: "Above/below" refers to two letters in the same column. "Left of / right of" refers to two letters in the same row.
(In reply to
a solution by Charlie)
Charlie, I programmed a full search, and the sole result was the matrix you show! Congratulations! The program took the clues in the order given, and derived equations to match the conditons. I H B -- test condition 1, then C N P -- test condition 2, then O M A -- test conditions 3 and 4, then K F L G -- test condition 5, then D E J -- test conditions 6 and 7. Execution time for completed program c. 0.2 seconds, but probably not optimal. I did not see an easy way to decide what order to take the clues. If my program turned up multiple solutions, I would have had to review the deductions to see if all fit all the conditions.