Data Structures & AlgorithmsHardTCS NQT · Infosys
How many distinct strings can be obtained from aabb by removing exactly one character?
- A. 2
- B. 3
- C. 4
- D. 6
Correct answer: A. 2
Removing either a gives abb and removing either b gives aab, so only two distinct strings arise.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- What is the sum of the decimal digits of 100!?
- How many trailing zeros does 1000! have in base 10?
- How many integers x in [1, 300] satisfy x ≡ 1 (mod 4) and x ≡ 2 (mod 3)?
- What is Euler's totient phi(360), the number of integers in [1, 360] coprime to 360?
- How many unordered pairs of distinct integers {a, b} from 1 to 12 are coprime to each other?
- What is the sum of i^3 mod 7 over i = 1 to 20?