Data Structures19 sections · 729 units
Open in Course

Quiz: Hash Set Usage

Time analysis

Check Your Understanding

In longest consecutive sequence, why do we only start counting when (num-1) is NOT in the set?

  1. A.To avoid counting duplicates
  2. B.To ensure we start from the beginning of each sequence, avoiding redundant work
  3. C.Because num-1 might cause integer overflow
  4. D.It's an optimization that doesn't affect correctness
Start the roadmap to answer the quizzes and solve the challenges