Data Structures & AlgorithmsHardCodeforces Div2 C · GATE CS

How many distinct two-character substrings occur in "mississippi"?

  1. A. 8
  2. B. 10
  3. C. 5
  4. D. 7

Correct answer: D. 7

Collect the 10 positional pairs into a set; repeated pairs such as "is" and "ss" count once. The distinct count is the answer.

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

Exams that ask this topic