How many queens and knights can you place on a chessboard?
This is a harder variant of the 8 queens problem. As a warm-up for this problem, consider solving that one first!
For the “queens and knights” problem, you want to place as many queens and knights, as possible, on a chessboard. However, queens and knights must be placed in equal numbers, and no piece can attack any other piece.
While you are at it, can you do it in multiple ways?
For reference, here is a picture showing what squares a queen attacks:
Similarly, here is a picture showing what squares a knight attacks:
Give it some thought!
If you need any clarification whatsoever, feel free to ask in the comment section below.
This problem was brought to my attention by the late Roger Hui, so let my sharing this problem be a small tribute to him.
Congratulations to the ones that solved this problem correctly and, in particular, to the ones who sent me their correct solutions:
Know how to solve this?
Join the list of solvers by emailing me your solution!
I'll share the solution to this problem after it has been live for 2 weeks.
Don't forget to subscribe to the newsletter to get bi-weekly problems sent straight to your inbox.
If you enjoyed this blog article, you will love the mathspp insider 🐍🚀 newsletter! Join +16.000 others who are taking their Python 🐍 skills to the next level! 🚀