Data Structures & AlgorithmsHardCodeforces Div2 C · GATE CS

How many distinct characters occur at least twice in "programming"?

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

Correct answer: D. 3

In "programming", r, g and m each appear twice, while o, a, i and n appear once, so three letters repeat.

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

Exams that ask this topic