The Attack of Queen
Chef has started developing interest in playing chess, and was learning how the [Queen](https://en.wikipedia.org/wiki/Queen_(chess)) moves. Chef has an empty $N \times N$ chessboard. He places a Queen at $(X, Y)$ and wonders - What are the number of cells that are under attack by the Queen? **Notes:** - The top-left cell is $(1, 1)$, the top-right cell is $(1, N)$, the bottom-left cell is $(N,
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.
Sign in to chat with the tutor and save your progress.
Sign in to start