← All problemsSign in

N Knights Problem

CodeChefRating 2047Open on judge ↗

Dave recently mastered the problem of placing N queens on a chessboard so that no two queens attack eachother. Now he wants to see how many knights he can place on a chessboard so that no two knights attack eachother. Normally this would be a simple task, but some of the squares of the chessboard have been marked as unusable and hence cannot have a knight placed on them. Recall that a knight can

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start