Graphs
LC-323. Number of Connected Components
LC-323. Number of Connected Components on FaangDeck — pattern-first lesson. Signals, template, trap, Python solution, complexity, and interview playbook…
What's inside this lesson
- Hook & First Instinct — frame the problem like an interviewer expects
- Brute force → Insight — what's redundant, what to exploit
- Recognition signals — three cues in the problem that point to this pattern
- Canonical template + adapted solution — clean Python, line-commented
- The trap — the near-correct bug everyone hits first time
- Trace + complexity — step-by-step walkthrough + time/space
- Interview Playbook — what to actually say in the room
About FaangDeck: a free, pattern-first DSA curriculum for FAANG interview prep. 217 visual lessons across 19 topics, organised into a 6-phase learning path. Covers Blind 75, NeetCode 150, and Grind 75. 1,503 quiz questions + 1,052 flashcards. No signup, works offline.