Bird
Raised Fist0

Why is it important to check both diagonals in win condition checking for square boards?

hard🧠 Conceptual Q10 of Q15
LLD - Design — Tic-Tac-Toe Game
Why is it important to check both diagonals in win condition checking for square boards?
ABecause checking diagonals is faster than rows or columns
BBecause diagonals always have the highest priority in winning
CBecause diagonals contain fewer cells than rows or columns
DBecause a win can occur along either diagonal, not just rows or columns
Step-by-Step Solution
Solution:
  1. Step 1: Understand win patterns on square boards

    Wins can occur in rows, columns, or diagonals; ignoring diagonals misses valid wins.
  2. Step 2: Evaluate other options

    Diagonals do not have priority or speed advantage; their length equals rows/columns.
  3. Final Answer:

    Because a win can occur along either diagonal, not just rows or columns -> Option D
  4. Quick Check:

    Wins can be diagonal too [OK]
Quick Trick: Check diagonals because wins can be there [OK]
Common Mistakes:
MISTAKES
  • Ignoring diagonal wins
  • Thinking diagonals are faster
  • Assuming diagonals have priority

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes