Data Structures & AlgorithmsHardTCS NQT Digital · Product Company SDE

Problem: Deleting exactly one character from "aabca" produces some strings. How many distinct strings can result?

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

Correct answer: D. 4

Different deletion positions can give the same string when the deleted character is repeated. Counting the five positions directly overcounts.

More Coding Interview Problems questions

Exams that ask this topic