Data Structures & AlgorithmsHardCodeforces Div2 C · GATE CS

How many starting positions in "abcbabcab" match the pattern "abc" with exactly one mismatched character?

  1. A. 1
  2. B. 3
  3. C. 2
  4. D. 0

Correct answer: D. 0

Count windows with exactly one mismatch by direct comparison; exact-match counting (the last option) ignores the one-mismatch windows entirely.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic